Personal tools
Views

FAQ/Add PHP

From CMSMS

This page in: English - Deutsch - Français - Svenska - Русский - Norsk - Polski - Nederlands - Español - Lietuvių

How to add php code in a page

There are some ways to add php code inside templates or pages, which should be shown in the following:

  1. Use a User Defined Tag.
  2. Edit your config.php, change $config['use_smarty_php_tags'] from false to true and clear cache. Now you can insert php source with mask {php}your_source{/php}. Note: It's a bit risky and unsecure.
  3. This is a mix of both. Create a User Defined Tag named extfile and insert the following
include($params['filename']);

Now you can call every php source with {extfile filename='path/to/your/file.php'}. Be sure that file.php is located inside a secure folder (not accessible to the web server).


This page in: English - Deutsch - Français - Svenska - Русский - Norsk - Polski - Nederlands - Español - Lietuvių