public function get_resto(){
$id = $this->input->get('id');
$this->load->model('RestoModel');
$where = array('id' => $id);
$row = $this->RestoModel->getRow( $where );
$data['pictures'] = $this->RestoModel->getPictures($id);
$data['menus'] = $this->RestoModel->getMenus($id);
$data['r'] = $row;
$this->load->view('restaurants/resto', $data);
}
我想将此功能也称为另一页。
$ this-> load-> view(' member / resto',$ data);
我该怎么做?
答案 0 :(得分:1)
您必须将实例保存到其他变量......
像:
$myObject = new MyClass();
然后你可以像这样调用类之外的公共函数:
$myObject->myFunc();
"此"你必须使用存储ObjectInstance的变量