public function actionIndex() { $main = new Model_Lot(); $this->view->numAnchors = $main->getNumAnchors(); if ($this->request->page == "") { $this->view->lastGoods = $main->getLastGoods(); $this->view->render('index'); $this->view->display(); } else { $data = $main->getLastGoods(); echo json_encode($data); exit; } }