Esempio n. 1
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
Esempio n. 2
0
 /**
  * 
  * 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);
 }