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

    Can somebody tell me how can I access $_SERVER Variables in my views

    • CommentAuthorKaste
     

    Actually you can't, use a helper, or assign a instance variable in the controller.

    • CommentAuthorspykid
     

    but when i assign $_server to any var in controller it stops displaying the view

    •  
      CommentAuthorbermi
     

    @spykid, variables and methods starting with an underscore are supposed to be private by convention.

    By default $_SESSION is available on views as $session :) you even use Sintags {session-index?}

    • CommentAuthorspykid
     

    hey thanks bermi, but i want to access $_SERVER not $_SESSION...

    •  
      CommentAuthorbermi
     

    Oops sorry.

    Then you'll need to add in your app/application_controller.php:

    function __construct()
    {
        $this->server = $_SERVER;
    }
    

    and in your views use $server

    • CommentAuthorspykid
     

    hey, dude you rock.... it solved my problem