public function __construct() { $this->_registry = Registry::getInstancia(); $this->_acl = $this->_registry->_acl; $this->_request = $this->_registry->_request; $this->_view = new View($this->_request, $this->_acl); }
public function __construct() { parent::__construct(); //carga el registro para reutilizarlo $this->_registry = Registry::getInstancia(); $this->_modelo = new cetprosModel(); }
public function __construct() { $this->_registry = Registry::getInstancia(); //instancia la base de datos del sistema y la red $this->_db = $this->_registry->_db; //$this->_dbs = $this->_registry->_dbs; //instancia la base de datos de los cetpros $this->_dbMod = $this->_registry->_dbMod; }
public function __construct() { //No se crea una nueva instancia, se utiliza el mismo metodo $this->_registry = Registry::getInstancia(); $this->_acl = $this->_registry->_acl; //Como ya la clase request esta almacenanda en el registro //se accede al registro $this->_request = $this->_registry->_request; $this->_view = new View($this->_request); }
public function __construct() { $this->_registry = Registry::getInstancia(); // Aqui no crea una instancia, ya que ya esta creado //De esta forma solo tenemos un objeto acl $this->_acl = $this->_registry->_acl; $this->_request = $this->_registry->_request; //Request ya esta instanciado en Registry y por tanto usa la misma instancia $this->_view = new View($this->_request, $this->_acl); // Se parasa acl para que esté disponible en las vistas //Cuando heredan los controladores y nos aseguramos que siempre haya un view en los controladores. }
public function __construct() { $this->_registry = Registry::getInstancia(); #$this->_menu = new menu(); Ex: $this->_view = new View(new Request, $this->_menu); $this->_acl = $this->_registry->_acl; $this->_request = $this->_registry->_request; $this->_view = new View($this->_request, $this->_acl); $this->_ip = new Env_ip(); $this->_Log = new logsModel(); $this->getLibrary(array('class.oemail', 'class.validators')); // Carga la libreria de validacion de email $this->_view->setJsPlugin(array('tooltip')); $this->_roles = new ACL(); }
public function __construct($id = false) { if ($id) { $this->_id = (int) $id; } else { if (Session::get('id_usuario')) { $this->_id = Session::get('id_usuario'); } else { $this->_id = 0; } } $this->_registry = Registry::getInstancia(); $this->_db = $this->_registry->_db; //$this->_role = $this->getRole(); //$this->_permisos = $this->getPermisosRole(); }
public function __construct($id = false) { if ($id) { $this->_id = (int) $id; } else { if (Session::get('id_usuario')) { //id_usuario se declara en el login $this->_id = Session::get('id_usuario'); //Si el usuario se ha registrado coge su id } else { $this->_id = 0; //Si el usuario no se ha registrado el acceso está registrido. } } $this->_registry = Registry::getInstancia(); $this->_db = $this->_registry->_db; $this->_role = $this->getRole(); $this->_permisos = $this->getPermisosRole(); $this->compilarAcl(); }
public function __construct() { $this->_registry = Registry::getInstancia(); $this->_db = $this->_registry->_db; }
<?php ini_set('display_errors', 1); define('DS', DIRECTORY_SEPARATOR); define('ROOT', realpath(dirname(__FILE__)) . DS); define('APP_PATH', ROOT . 'application' . DS); define('TIMEZONE', 'Europe/Madrid'); try { require_once APP_PATH . 'Autoload.php'; require_once APP_PATH . 'Config.php'; /* Configurar parametros de hora del sistema */ date_default_timezone_set(TIMEZONE); Session::init(); $registry = Registry::getInstancia(); $registry->_request = new Request(); $registry->_db = new Database(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_CHAR); $registry->_acl = new ACL(); Bootstrap::run($registry->_request); } catch (Exception $e) { echo $e->getMessage(); }