$this->render('output');
은 메서드 이름에 관계없이 해당 뷰가 대신 렌더링됩니다.
또는 $this->render('/OutputController/output');
보기 컨트롤러 외부에서.
달성하려는 대상에 따라 요소가 더 나은 선택 일 수 있습니다.
즉
//output controller
$this->render('output');
//posts controller
$this->render('/Output/output');
편집 : 시스템이 나를 이렇게 (8 분)을 수행 할 수 있습니다 때
<?php
class AdminApiController extends AppController {
var $uses = array('Post', 'User', 'Application');
public function posts() {
$this->layout = 'ajax';
$this->set('data', $this->Post->find('all'));
$this->render('/Api/output');
}
public function user() {
$this->layout = 'ajax';
$id = $this->Auth->user('id');
$this->User->id = $id;
$this->request->data = $this->User->read(null, $id);
unset($this->request->data['User']['password']);
unset($this->request->data['User']['password_token']);
$this->set('data', $this->request->data['User']);
$this->render('/Api/output');
}
public function applications() {
$this->layout = 'ajax';
$this->set('data', $this->Application->find('all'));
$this->render('/Api/output');
}
우수가 ... 받아 들일 것입니다 감사합니다 작업 고생 클래스 ... :) – Ondrej