Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Intergrate include 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: 575 Views
  • Flexart
    Avatar
    Community Member
    3 Posts

    Intergrate include php file Link to this post

    Is there a way to integrate a include PHP file in Silver stripe CMS?

    Thanks

    Edwin

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Intergrate include php file Link to this post

    Please explain in more detail what this PHP file is. If it simply echos values then no, you cannot use it. If it returns something (like an array) then you just need a custom function..

    // mysite/code/Page.php

    function IncludeSomethingCool() {
    require_once('something/cool.php');

    // say that cool.php contains a static method foo
    return cool::foo();
    }

    Then in your template use $IncludeSomethingCool.

  • Flexart
    Avatar
    Community Member
    3 Posts

    Re: Intergrate include php file Link to this post

    Hi

    I have a Php Calender that i would like to integrate in one of the SS files.

    <?php include('calendar.php'); ?>

    Thanks

    Edwin

    575 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.