PhpRiot
Follow phpriot on Twitter
Sponsored Link

Listing 3720

Submitted by alf, 2 September 2010
<?php
 
class Controller
{
    private $_oSession;
    
    /**
    * @param Session $oSession Contains methods to read/write into $_SESSION
    */
    function __construct($oSession) {}
    
    function render()
    {
        if ( $this->_oSession->isUserLogged() )
        {
            $oUser = $this->_oSession->getUser();
        }
        
        // Some code using $oUser...
    }
    
}
?>
Submit a Follow Up