by (14.9k points)
edited by
Sometimes,  I need to call some data from another application into a page directly using PHP. Is there a way to add some PHP or other code directly into a Toaster page?

1 Answer

by (14.9k points)
 
Best answer
There is a very simple way to add PHP code in a toaster page through the {$code:somename} tag ... this one tag is disabled in toaster2 by default, but you can re-enable it manually if you need:

1. Go to your phpmyadmin or any other tools you are using to manage you database
2. Go to the config table and change value for the codeEnabled param to 1
3. Go to any of your templates and add some code containers e. g. {$code:your_code_container_name}
4. open the container and add your code in it..
Note: if you add some PHP code, do not add the "<?PHP  | ?>"opening and closing tags.

It is of course better to code your own nice plugin! --> We are preparing a good 'how to' for our plugins system. It will be online soon. Stay in touch with us!

T
by (1.3k points)
can you give an example?
...