Jump to content

How to include a global file in every page (Smarty template))


Manaus
 Share

Recommended Posts

Hello, I'm using the Smarty Template engine, and I would like to include a 'variables' file in each page, without explicitly including it in every file (I'm lazy and dry ?, either .php or Smarty template. Something like functions.php in WP environment. If not possible, what is the best way?

Thanks

Link to comment
Share on other sites

https://github.com/blue-tomato/TemplateEngineSmarty

Check the last part of the docs, Extending Smarty, it has an example on how to register object/functions. 

Quote

Something like functions.php in WP environment

If I understand correctly functions.php, the kind of functionality that it enables would translate on the hook system of ProcessWire.

https://processwire.com/docs/modules/hooks/

  • Like 1
Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...