The view contains the description, keywords, contact, etc… of the webpage ....... These are stored in the database. How can they be called in the template by writing them in only one location? For example, & amp; lt ;? Phpecho $ system-& amp; gt; keywords ;? & Amp; gt; you can output keyword information without having to write the description, keywords, contact, etc… of the webpage in each controller ....... These exist in the database,
How can I call a template by writing it at only one position?
For example keywords;?>You can output the keyword information instead of writing it in each controller.
Reply content:
The view contains the description, keywords, contact, etc… of the webpage ....... These exist in the database,
How can I call a template by writing it at only one position?
For example keywords;?>You can output the keyword information instead of writing it in each controller.
You can use»Class Library Reference»Loader classInvarsMethod
Document address
The usage method is constructed in MY_controller.php:
$this->load->vars('yourglobalvars','yourvalues');
All your controllersInheritance MY_controllerIn this way, you can use this variable in all view templates that inherit the controller.
yourglobalvars;?>
It can be placed in the cache and then pulled directly from the cache.
Try it.traitReusable code blocks. For more information, seePhp Manual
Customize the class and set the class to auto load when the database puts data
I wrote an article by referring to my blog.
Link
You can directly add $ this-> load-> view () to the view.