- echo 'Hello World!';
Hello PHP World |
the taskAssuming we want to execute a simple script: A - use scriptletIn the first version we do this by using the {scriptlet}-tag... 1) Install Moslate 2) Import the samples_export 3) Edit a content-item (assuming you didn't change any configuration yet) and write:
If you then view the content on the frontpage for example this should show:
If it does not (skip this part if it does): 1) and you see {moslate}, then Moslate is not properly installed or the configuration was changed... a possible reason is that the Legacy Mambot is not published... then go to Site Mambots and publish it... there is also a seperate Mambot included, which you could install, in case you do not want to use the Legacy Mambot 2) not 1) but it shows {scriptlet} then the content you edited was maybe not owned by someone who is part of the group "special" (like the Administrator for example)... you could go to Manage Moslate and set the Access to public (but this is really dangerous if someone else is able to edit content) 3) please ask me B - without moslate-tagOk, it works but you may don't like to place {moslate}...{/moslate} in your content (skip this if you don't care) 1) Go to Moslate configuration make the Mos Tag-field empty (you may need to type a space) 2) Go to content and remove {moslate} and {/moslate} View the content and it should show the same C - create moslateNow you don't want to place that script in every content... make your own moslate(mambot)... 1) Go to Moslate Categories and create a Category (or skip this and use an existing) 2) Go to Manage Moslate and click on New 3) For the name you may choose: helloworld 4) In your template code write:
6) for mode choose: Eval PHP 7) edit your content item again and write:
And again it should show the same D - dynamic moslateNow assuming you want to have something like: echo 'Hello '.$name.'!'; 1) Go to Manage Moslate 2) Edit the helloworld-moslate 3) Change the template field to:
And well, what you should see is:
|