1
我很困惑我的控制器應該有什麼,以及我的方法。Zend Framework-在哪裏調用我的方法去?模型控制器?
具體來說,我有這樣的操作方法:
public function upcomingshowsAction()
{
$gcal = $this->_validateCalendarConnection();
$uncleanedFeedArray = $this->_getCalendarFeed($gcal);
$finishedFeedArray = $this->_cleanFeed($uncleanedFeedArray);
$this->view->googleArray = $finishedFeedArray;
}
然後(不正確,我知道),我有我的方法還是在我的控制器的底部。
那麼是什麼我不知道,是在upcomingshowsAction方法這些方法,都應該實際的方法僅僅是一個模型,然後我有這樣的事情:
public function upcomingshowsAction()
{
$finishedFeedArray = new Application_Model_calendarModelPage();
$this->view->googleArray = $finishedFeedArray;
}
然後什麼像這樣的模型:
class Application_Model_CalendarModelPage
{
$gcal = $this->_validateCalendarConnection();
$uncleanedFeedArray = $this->_getCalendarFeed($gcal);
$finishedFeedArray = $this->_cleanFeed($uncleanedFeedArray);
public functions
{
...
...
...
}
}
我在正確的軌道上嗎?
謝謝!