Solved

Expression Engine Include Class and methods

Posted on 2015-02-04
3
65 Views
Last Modified: 2015-02-20
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?
0
Comment
Question by:rgranlund
  • 2
3 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40591619
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
 
LVL 7

Author Comment

by:rgranlund
ID: 40591753
How do I write that?

{include_once = "php_classes/quote"}
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 40591793
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Searchbox Branding 11 45
form button worked now it doesnt anymore 9 42
php string masking 4 29
geting geocode of a user with using Google maps api 8 19
Read about why website design really matters in today's demanding market.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now