Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Adding in PHP code


Go to End


2 Posts   2976 Views

Avatar
Magicmark

Community Member, 1 Post

29 April 2010 at 2:55am

I've just started looking into Silverstripe having developed a couple of sites in Wordpress and found it not quite fitting my needs. Open Source is great but a client will always ask for bits adding on.

So... I am looking a add a zip code locator such as 'Lookup Runner' to my silverstipe site http://www.lookuprunner.com does anyone know if this sort of thing is possible.

Thanks in advance

Avatar
mark_s

Community Member, 78 Posts

12 May 2010 at 9:53pm

Hi.

Yes, you can add PHP code from other sources into your SilverStripe site. A common practice is to create a "thirdparty" directory in your mysite folder (or module folder, if you're creating a module).

You may want to exclude that PHP code from being included by the manifest builder when a dev/build is run. This can be achieved by creating a file called _manifest_exclude in the folder that contains the third party code. (Note the leading underscore).

Then you can require() that code as requires in your site logic.

Mark