예제 #1
0
 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $this->_view = Zend_Registry::get('view');
     $currentUrl = $this->_view->currentUrl('currentUrl');
     $model = new Modules_Seo_Model_Seo();
     $this->_data = $model->findByUrl($currentUrl);
 }
예제 #2
0
 public function indexAction()
 {
     $form = new Zetta_Form(Zend_Registry::get('config')->Seo->form);
     $data = $this->_model->findByUrl($this->view->currentUrl);
     if (sizeof($data)) {
         $form->setDefaults($data->toArray());
     }
     if (!sizeof($_POST) || !$form->isValid($_POST)) {
         $this->view->form = $form;
     } else {
         $arrayData = array('title' => ($title = $form->getValue('title')) ? $title : new Zend_Db_Expr('NULL'), 'keywords' => ($keywords = $form->getValue('keywords')) ? $keywords : new Zend_Db_Expr('NULL'), 'description' => ($description = $form->getValue('description')) ? $description : new Zend_Db_Expr('NULL'));
         $this->_model->save($arrayData, $this->view->currentUrl);
         $this->renderScript('admin/addComplete.ajax.phtml');
     }
 }