Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony output only template--without adding to layout.php

Is there any way to disable the addition of layout.php to my actionNameSuccess.php? I would like this setting to be enabled for some modules and disabled(i.e. let layout.php add up) for other modules.

I can solve the problem by making a new application and setting its layout.php to just

<?php echo $sf_content?>

but I would like a same-application solution. Since I need to have links between these two and link_to only works relative to an application and I don't want to pass an absolute url.

like image 439
prongs Avatar asked Dec 11 '11 14:12

prongs


1 Answers

You can call $this->setLayout(false); in your action. I think you may also achieve this with the view.yml file.

UPDATE: as denys281 pointed out, the way to do this in view.yml is to use

has_layout: false
like image 109
greg0ire Avatar answered Sep 19 '22 09:09

greg0ire