는 다음과 같은 오류 해결하는 방법에 대한 조언을 할 수 배열로 형 모델의 개체를 사용할 수 없습니다 :KOHANA - ErrorException [치명적인 오류] :
ErrorException [ Fatal Error ]: Cannot use object of type Model_Branch as array
참조하십시오를 컨트롤러 :
public function action_view($agent_id='') {
$agent = ORM::factory('agent', $agent_id);
if ($agent->loaded()) {
$values = $agent->as_array();
$branches = $agent->branches->find_all()->as_array();
// Show page
$this->template->title = $agent->company_name;
$this->template->content = View::factory('agent/view')
->bind('title', $this->template->title)
->bind('values', $values)
->bind('branches', $branches);
} else {
Request::instance()->redirect('agent');
}
}
예외를 던지는 부분을 표시하십시오. 컨트롤러가 아닌 컨트롤러처럼 보입니다. – biakaveron