How can I create custom variable in helper.php file set it right here and use it in tmpl file? Example:
in helper.php I add variable
$customstring = 'My string';
Then I want to display this variable in i.e tmpl/default.php
<?php echo $customstring; ?>
Not working. What’s wrong here?
Your helper file should contain a function or class and should return the result(s) you want to pass back.
If your module’s main file is similar to the mod_weblinks.php file
You populate your variable like so
and $list is in scope and automatcally available to you within your view and its tmpl files.
If your module is more complex then have a look through some of the other modules within the site.