Solved

Expression Engine Include Class and methods

Posted on 2015-02-04
3
59 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

705 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

16 Experts available now in Live!

Get 1:1 Help Now