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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Call function from php file


Reply

3 Posts   589 Views

Avatar
ambient

6 August 2011 at 12:46am Community Member, 123 Posts

Hi again Silverstripe community

I've been getting some help from a friend on something I'm trying but my friend has told me to call the function from the file he gave me.

Can someone tell me how to call the function from a php file in Silverstripe?

Project/TestFile.php

<?
require_once "project.php";

project_recent_sidebar("myaccountnamehere",10,0,"left","Text Here",true,"top","",true);
?>

Thanks :)

Avatar
zenmonkey

6 August 2011 at 6:53am Community Member, 528 Posts

This one potentially really simple. Put the project.php into your mysite/code and do a dev/build?flush=all to rebuild the manifest. You may need to tweak the name of the file or the class in it to fit into the SS namespace. Then you don't even need to use require_once its just available.

Avatar
ambient

17 August 2011 at 12:54am Community Member, 123 Posts

Thanks zenmonkey :)