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

    Hi, It seems that the views folder is having folders similar to controller name which has tpl files for rendering content section and a layouts folder again has file similar to controller name which provides the page layout.

    I have two layout files to govern the sites main page and all inner pages. I want the inner page layout to be included for inner pages and main layout for home page. Say calling the url

    http://booklink.local.com/?ak=/home/  should pick up the /views/layouts/main.tpl and 
    http://booklink.local.com/?ak=/author/ should pick up the /views/layouts/inner.tpl  for inner pages.
    

    So calling /author as the controller ( in fact any controller other than home ), should call inner.tpl for page layout and the respective content part from /views/author/list.tpl say in this case.

    Any idea how to achieve this?

    Greet!

    • CommentAuthorOmeZ
     
    hm.... very easy, you should read documentation at AkController.php (Layers)

    you put to your shared controller var $layout='inner'; this directive will be inherited for all controllers. After that you setup var $layout='main'; in your home controller, voila! all your controllers inherit inner layour, except home for which you set explication to use main layout
    • CommentAuthormilind
     
    Thanks OmeZ once again!

    The other issue I am facing now is how to access the model object in the controller once the model is organized into folder.
    The Model class name that gets generated in this case is Admin::Author. So how this will be accessed thru controller.