Jump to:

3392 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » renderWith() template on its own

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

Page: 1
Go to End
Author Topic: 837 Views
  • Vladas
    Avatar
    Community Member
    17 Posts

    renderWith() template on its own Link to this post

    So I'm trying to render my page. I have action function within Page_Controller class called ViewSavedJobs. I want so when I call a link in browser http://localhost/Project/ViewSavedJobs, I get a page rendered with ViewSavedJobs.ss that's stored within root of templates folder.

    Now what I get is that all defined Requirements within Page.php appear on my rendered page. What is the solution to renderWith() page without all the Page.php Requirements? I don't want to create a separate Page class for that. I need solution so I could use renderWith or something similar.

    Thanks.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: renderWith() template on its own Link to this post

    It uses the requirements you have defined on your controller, irrespective of if your template extends Page since the template engine has no idea about those things. You could call Requirements::clear() before rendering your template which would clear all the requirements defined on that controller.

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