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

    I'm trying to do a little bit of switching inside a add.tpl, but have run across something a little odd.

    In add.tpl this works fine: $somevar = "1"; However, this$level = $_SESSION['list_physical_level']; throws an error like such: Catchable fatal error: Object of class Part could not be converted to string in /akelos/lib/AkActionView/AkPhpCodeSanitizer.php on line 162

    Does anyone know of a way I can access $_SESSION variables inside the tpl views?

    Thanks!

    • CommentAuthorsuthern
     

    I've decided to go another route and put the switching into the _controller.php where it belongs. The question still piques my interest though. ;=)

    • CommentAuthorKaste
     

    You can't access $_SOMEthing-globals inside a view. Either assign a instance-variable on the controller, call a helper-function, or:

    <? $controller->Request->getSession(); ?>
    

    The thrown error is a bug, though. You should see a nice, helpful error message.