public static function getInstance() { if (!isset(self::$instance)) { $c = __CLASS__; self::$instance = new $c(); } return self::$instance; }
/** * * Form add */ function indexAction() { $id = $this->_getParam('id'); $option = $this->_getParam('option'); $option = !empty($option) ? $option : 'add'; $this->view->assign('heading', $this->_lable[$option]['value'] . ' Locations'); $data = array(); if (!empty($id) && $option == 'edit') { $this->_model->primary = $id; $data = $this->_model->getItemById(); } $this->view->assign('data', $data); $this->view->assign('option', $option); $countries = Front_Model_Countries::getInstance()->Items(); $this->view->assign('countries', $countries); }