ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new in Expression engine. I know that We can not write PHP code in template due to security reason. I want to know the flow like from where can write php code and how it will render in my template ?

share|improve this question

Which version of EE are you working with?

EE allows use of PHP in templates, but there are security factors to be aware of before you enable it, so you have to enable PHP processing on a per-template basis. PHP should not be a problem provided you have a good control of who can edit templates in your EE setup - vis:

Enabling PHP in a template will enable anyone with editing rights for that template to become a de-facto Super Admin since they can execute any PHP they want in that template

You can find out more about how to embed PHP in EE templates from the EE documentation

EE2 - https://docs.expressionengine.com/v2/templates/php.html

EE3 - https://docs.expressionengine.com/latest/templates/php.html

HTH

share|improve this answer
    
Thanks Gavin for your quick replay. I am working with EE version 2.5.5. – Rakesh Angre May 16 '16 at 10:39
    
I already go through with given link. But Do we have any other way to run PHP code without Enabling PHP on template ? – Rakesh Angre May 16 '16 at 10:42
    
Try writing a plugin, then you have an EE tag that runs the php for you. – Jim Wyse May 16 '16 at 12:40
    
Thanks Jim wyse. – Rakesh Angre May 18 '16 at 9:35
    
JIm Wyse : I have follow your instruction and it's working fine now. – Rakesh Angre May 20 '16 at 10:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.