Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthortom
     

    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.

    •  
      CommentAuthorriffed
     

    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"));

    • CommentAuthortom
     
    yep, have tried it, without success...
    •  
      CommentAuthorriffed
     

    The following works for me, $this->renderText('Hello Tom'); $this->renderNothing('404') sends a 404 status code.

    • CommentAuthortom
     

    Does

    $this->renderText('Hello Tom');
    

    also work for you when you use a layout around the text?

    • CommentAuthorKaste
     

    render :text doesn't work with layouts. so this feature is not implemented. TRAC?