예제 #1
0
파일: controller.php 프로젝트: soanni/mvc
 public function render()
 {
     if ($this->getUser()) {
         if ($this->getActionView()) {
             $this->getActionView()->set('user', $this->getUser());
         }
         if ($this->getLayoutView()) {
             $this->getLayoutView()->set('user', $this->getUser());
         }
     }
     parent::render();
 }
예제 #2
0
 /**
  * Checks whether the user is set and then assign it to both the layout and action views.
  */
 public function render()
 {
     /* if the user and view(s) are defined, 
      * assign the user session to the view(s)
      */
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
         }
     }
     parent::render();
 }
예제 #3
0
 /**
  * Override \Framework\Controller\render() and
  * assign the $_user to both action and layout views
  * @return void 
  */
 public function render()
 {
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
         }
     }
     // If the request was not XHR then render the view
     if (!$this->ajax) {
         parent::render();
     }
 }
예제 #4
0
 /**
  * Checks whether the user is set and then assign it to both the layout and action views.
  */
 public function render()
 {
     /* if the user and view(s) are defined, 
      * assign the user session to the view(s)
      */
     $session = Registry::get("session");
     $tracks = $session->get('User:$pListTracks');
     $current = $session->get('Users:$currentPlaylist');
     $playlists = $session->get('User:$playlists');
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
             if ($tracks) {
                 $this->actionView->set('current', $current);
                 $this->actionView->set('playlists', $playlists);
                 $this->actionView->set('plistTracks', $tracks);
             }
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
             if ($tracks) {
                 $this->layoutView->set('current', $current);
                 $this->layoutView->set('playlists', $playlists);
                 $this->layoutView->set('plistTracks', $tracks);
             }
         }
     }
     parent::render();
 }