Rendering controller to a different view in CakePHP

后端 未结 7 1087
长发绾君心
长发绾君心 2021-02-01 16:10

Is there a way to render a controller to a different view then normal? I\'m trying to pass some data from the controller to a non-default view. Meaning my controller is called:<

7条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 16:57

    public function admin_index() { 
    
        $this->layout = 'admin/table';
    
        $action = '/Vendors';
    
        $this->Prg->commonProcess('Vendor');
    
        $this->paginate = array('conditions' => array($this->Vendor->parseCriteria($this->passedArgs)), 'order' => 'Vendor.created_on DESC', 'limit' => 15);
    
        $this->set('vendor', $this->paginate('Vendor'));
    
        $this->render('/vendors/admin_items');
    }
    

提交回复
热议问题