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

    I need to create a multi-level menu system in my layout with data from the database. This data has to be available on every page, where do I make the call to the controller? In a helper?

    • CommentAuthormkhatib
     

    In rails, there's the application_controller, so there you can put the action you want to get the data from the database for your menu, but for akelos i don't know if page_controller has the same functionality as application_controller in rails.

    • CommentAuthorsuthern
     

    On EVERY page, or only on pages from a certain model?

    What I did for a footer (not data from a database) was to put a footer.tpl inside the "views \ layouts" folder. Then inside each model_name.tpl I inserted

    <%= render_partial 'layouts/footer' %>
    

    just under the line:

    <?php  echo  $content_for_layout ?>
    

    Perhaps not the best way to do it, but I couldn't find any documentation on application-wide render_partial's. Perhaps someone with more experiance than I can explain a better (global) way to do a database select and push to each model.

    • CommentAuthorKaste
     

    application_controller has the same functionality as application_controller.

    but a helper combined with a partial is a good match and easier to test.