Jump to:

22976 Posts in 11667 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Call function from php file

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

Page: 1
Go to End
Author Topic: 527 Views
  • ambient
    Avatar
    Community Member
    113 Posts

    Call function from php file Link to this post

    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

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Call function from php file Link to this post

    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.

  • ambient
    Avatar
    Community Member
    113 Posts

    Re: Call function from php file Link to this post

    Thanks zenmonkey

    527 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.