Hi,
how can I just render some string, but with a layout?
When I use
render( array('text'=>'42', 'layout' => 'standard'));
the layout is not used.
Plus: rendering nothing seems to require a template for some reason.
Is that a bug or the intended behaviour?
Regards,
T.
From the source:
=== Rendering text
Rendering of text is usually used for tests or for rendering prepared content, such as a cache. By default, text rendering is not done within the active layout.
Renders the clear text "hello world" with status code 200 $this->render(array('text' => 'hello world!'));
Renders the clear text "Explosion!" with status code 500 $this->render(array('text' => "Explosion!", 'status' => 500 ));
Renders the clear text "Hi there!" within the current active layout (if one exists) $this->render(array('text' => "Explosion!", 'layout' => true));
Renders the clear text "Hi there!" within the layout * placed in "app/views/layouts/special.tpl" $this->render(array('text' => "Explosion!", 'layout => "special"));
The following works for me, $this->renderText('Hello Tom'); $this->renderNothing('404') sends a 404 status code.
Does
$this->renderText('Hello Tom');
also work for you when you use a layout around the text?
render :text doesn't work with layouts. so this feature is not implemented. TRAC?
1 to 6 of 6