Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthortuntis
    How do I pass data to a layout from a controller? No matter what I try, it doesn't seem to work.

    (oh, and some real documentation would be nice)
    • CommentAuthorKaste

    Just do

    $this->MyVar = "here we go";

    in a controller.

    Now you can

    echo $MyVar; 

    in the view.

    • CommentAuthorenser
    Does anybody know how I can invoke method from the controller in layout? The method returns some value.
    For ex. the method is.

    class ApplicationController extends AkActionController
    var $layout = 'page';
    var $user_details_session_name = 'user_details';

    function isUserInRoleAdmin(){
    $user = $_SESSION($this->user_details_session_name);
    if(!empty($user) && (!empty($user['usert_type_id'])) && $user['usert_type_id'] == 1){
    return true;
    return false;
    • CommentAuthorenser
    OK I think i found the solution: