Include .php files?

A forum for Bolt related questions / issues

Include .php files?

Postby dbrooke0830 » Thu Aug 28, 2014 8:36 pm

Hello, I have a .php app that I built that I need to include between the header / footer of my Bolt site. How would
I do this?
dbrooke0830
 
Posts: 13
Joined: Wed Aug 06, 2014 11:07 pm

Re: Include .php files?

Postby dpfavand » Fri Aug 29, 2014 3:17 pm

Probably the most elegant way would be to write the php file as a Bolt extension that declares a Twig function. Then call the function from the template. See this section of the docs for details: https://docs.bolt.cm/extensions#add-a-twig-function-or-filter, the top of the page has information on how to create an extension - use the wizard to create an empty extension with a Twig function and then drop your php code into it at the right point.
Bolt-based site(s): http://us.phoneplanchoices.com.
dpfavand
 
Posts: 7
Joined: Sun Mar 02, 2014 10:33 pm

Re: Include .php files?

Postby dbrooke0830 » Mon Sep 15, 2014 4:48 pm

Thanks for the reply.. was starting to think this forum is dead. :)
I'll take a look at that today.
dbrooke0830
 
Posts: 13
Joined: Wed Aug 06, 2014 11:07 pm

Re: Include .php files?

Postby dbrooke0830 » Wed Sep 17, 2014 9:51 pm

I've looked at the extensions link and don't know that it will help me in my case.

To clarify my question, I've updated my issue to a new post here:

viewtopic.php?f=17&t=4744
dbrooke0830
 
Posts: 13
Joined: Wed Aug 06, 2014 11:07 pm


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron