[surforce-library commit] r53 - agrego validaciones antes de asignar las variables (evita errores si no están asignadas)

0 views
Skip to first unread message

codesite...@google.com

unread,
Jun 8, 2009, 7:31:31 PM6/8/09
to surforce...@googlegroups.com
Author: enriqueplace
Date: Mon Jun 8 16:30:27 2009
New Revision: 53

Modified:
trunk/library/Zsurforce/Generic/Controller.php

Log:
agrego validaciones antes de asignar las variables (evita errores si no
están asignadas)

Modified: trunk/library/Zsurforce/Generic/Controller.php
==============================================================================
--- trunk/library/Zsurforce/Generic/Controller.php (original)
+++ trunk/library/Zsurforce/Generic/Controller.php Mon Jun 8 16:30:27 2009
@@ -45,10 +45,17 @@
* Carga información desde el bootstrap (index.php).
*/
$this->_registry = Zend_Registry::getInstance();
+
+ if (Zend_Registry::isRegistered('debug')) {
+ $this->_debug = $this->_registry->get('debug');
+ }
+ if (Zend_Registry::isRegistered('devel')) {
+ $this->_devel = $this->_registry->get('devel');
+ }
+ if (Zend_Registry::isRegistered('config')) {
+ $this->_config = $this->_registry->get('config');
+ }

- $this->_debug = $this->_registry->get('debug');
- $this->_devel = $this->_registry->get('devel');
- $this->_config = $this->_registry->get('config');
$this->_user = Zend_Auth::getInstance()->getIdentity();

if( Zend_Registry::isRegistered('session')){
@@ -66,8 +73,13 @@
* Carga información para las vistas del sistema
*/
$this->initView();
- $this->view->basePath =
$this->_registry->get('base_path_app');
- $this->view->basePathHtml =
$this->_registry->get('base_path_html');
+ if (Zend_Registry::isRegistered('base_path_app')) {
+ $this->view->basePath =
$this->_registry->get('base_path_app');
+ }
+ if (Zend_Registry::isRegistered('base_path_html')) {
+ $this->view->basePathHtml =
$this->_registry->get('base_path_html');
+ }
+
$this->view->baseUrl = $this->_request->getBaseUrl();

$this->view->debug = $this->_debug;
Reply all
Reply to author
Forward
0 new messages