2015-03-12 1 views
-3
<?php 
class PublishersController extends AppController 
{ 

    public function index() 
    { 
     $this->set("publishers", 
      $this->Publisher->find("all", array('order' => 'company_name ASC'))); 
    } 

    public function view($id = null) 
    { 
     $this->Publisher->id = $id; 
     $this->set('publisher', $this->Publisher->read()); 
    } 

    function edit($id = null) 
    { 
     $this->Publisher->id = $id; 
     if (empty($this->data)) 
     { 
      $this->data = $this->Publisher->findById($id); 
     } 
     else 
     { 
      if ($this->Publisher->save($this->data)) 
      { 
       $this->Session->setFlash('Publisher Updated Successfully'); 
       $this->redirect(array('action' => 'index')); 
      } 
     } 
    } 
} 

?> 
+0

, пожалуйста, объясните подробнее –

+0

Это не вопрос – Luceos

+0

Где вы начинаете сеансы? – panther

ответ

5

Похоже, что вы не загружены класс сеанса.

В любом вашем AppController или ваш PublisherController вам нужно добавить следующее:

public $components = array('Session'); 

Это должно исправить.

+0

Благодарим за помощь! –