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

    Hello again =)

    I have problems with implementing the application wide layout. Shouldn't it be ./app/views/layout/application.tpl? Because I have such a file and it doesn't seem to be working. Is there some preferences to be edited (there shouldn't be, right?)

    -jyrki

    •  
      CommentAuthorbermi
     

    There is no default layout at Akelos. You need to specify the layout you want to use either in by controller or in the application_controller.php file by declaring

    var $layout = "layout/application.tpl";
    

    or you can name your file as your controller for Akelos to pick it up automatically.

    • CommentAuthoriJyrki
     

    Hmm.. I've added the line to application_controller.php, but no-go.

    var $layout = 'layouts/application.tpl';
    

    -jyrki

    •  
      CommentAuthorbermi
     

    Strange. Check if the file app/views/layouts/application.tpl exists.

    • CommentAuthoriJyrki
     

    It exists, is perfectly ok etc. But now it seems to be that if I use

    $this->render('something');
    

    the application layout won't work. Is there any way to make it work with the render function? And it seems that it doesn't need the

    var $layout = 'layouts/application.tpl';
    

    in application_controller.php - or anywhere.

    -jyrki

    • CommentAuthorsalavert
     

    $this->render() is used to send content to the browser as response body, so if you pretend to output some text from your controller try with Ak::trace('somthing') instead of using $this->render('something') and everything should be ok.

    PD. To output an array or object use Ak::debug($YourObject);

    • CommentAuthoriJyrki
     

    Ok, thanks salavert. That's not exactly what I'm after. I'm after a way to "render" another action, like

    function index()
    {
        $this->render('login'); // Trying to make this to render the login.tpl...
    }
    
    function login()
    {
    }
    

    I know, I'm quite a beginner when it comes to Rails styled code..

    -jyrki

    • CommentAuthorsalavert
     

    You're looking for this $this->renderAction('login')

    Other ways could be: $this->render(array('action'=>'login')); or $this->redirectToAction('login'); but your url will change to ~/login

    • CommentAuthoriJyrki
     

    Thank you, salavert! This solved the problem =)

    Although there still exists http://forum.akelos.org/discussion/2/filedirectory-permissions/#Item_26 problem in redirects.

    -jyrki

    • CommentAuthormuldy
     
    What is the akelos command for rails <% yield %> ?

    Can someone post a sample of a application.tpl (site wide layout)?
    • CommentAuthormuldy
     

    Just got an answer in irc, its:

    {content_for_layout}
    

    thanks jyrkililja

    •  
      CommentAuthorriffed
     

    You can specifiy a default layout by in application controller with

    var $layout = 'application';

    or

    $this->render(array('action'=>'long_goal','layout'=>'spectacular'));

    • CommentAuthorbloogrox
     
    only file name, without directory name
    var $layout = 'application.tpl'; !!!

    > var $layout = 'layouts/application.tpl';