Expression Engine Include Class and methods

I have a website built on Expression Engine.  I am having a hard time understanding how to include a PHP Class and it's functions.  I have a file that has the Class.  I tried using {embed=?php_classes/quote"} in the template but that does not work.  When I place the actual php Class code above the header it works fine.  Is there a special Include_Once EE syntax?
LVL 7
rgranlundAsked:
Who is Participating?
 
gr8gonzoConnect With a Mentor ConsultantCommented:
It's just regular PHP - no special EE syntax:

<?php
include_once("php_classes/quote");

Open in new window

...or whatever your filename is.
0
 
gr8gonzoConsultantCommented:
You can use the regular include_once PHP function - you just have to set the PHP to be parsed on output. The documentation page:

https://ellislab.com/expressionengine/user-guide/templates/php.html

Output: PHP parsed at the “output” stage happens later in the template parsing order, which means it will be parsed after the ExpressionEngine Tags are interpreted. This will allow you to use PHP to affect the “rendered Template”.
0
 
rgranlundAuthor Commented:
How do I write that?

{include_once = "php_classes/quote"}
0
All Courses

From novice to tech pro — start learning today.