Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » php include in Layout/NewPage.ss

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2740 Views
  • sammahoney
    Avatar
    Community Member
    14 Posts

    php include in Layout/NewPage.ss Link to this post

    Hi All

    Have a question. Can I put a php include in a Layout/page.ss file?

    Basically, I have a page from outside SilverStripe that I want to include. I tried the iFrame module but I don't have a specific page size as the page that will load into the frame is dynamic so the length can change.

    As a workaround, I made a new page type, with a new layout template - but can I call the page I need with php include? I tried it but I get an error. Any ideas?

  • sammahoney
    Avatar
    Community Member
    14 Posts

    Re: php include in Layout/NewPage.ss Link to this post

    SS developers, any word on this?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: php include in Layout/NewPage.ss Link to this post

    There is no way that I know of to embed PHP files in the template files - I think that would violate the whole MVC approach aswell. Your best idea is like you said, a seperate page type or convert your php to a Silverstripe class - doesnt need to be a page type if its not a whole page by itself but just a bit of functionality so it could extend DataObject instead of Page... anyway that and give it a separate page template would be the way to go

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