Jump to content

How to Assign Smarty Variables from a Module's Custom Php File


MEG Venture
 Share

Recommended Posts

Hi

 

I have several custom php files in my module's root. In order to clear the html from these files, I want to assign smarty variables and display the content in template files. However, I am having the below error and can't assign smarty. Could you please guide me?

Fatal error: Cannot access protected property MyModule::$context in C:\wamp64\www\16113\modules\mymodule\ajax.php on line 323

My code in ajax.php:

$num_rows = count($all_product_cnt);
$context = Context::getContext();
$mymodule->context->smarty->assign(
    array(
       'deneme' => '90',
    )
);
Edited by MEG Venture (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More