$loader->registerNamespace('Qool_'); //register the Templates $loader->registerNamespace('Templates_'); //get the controller object $frontend = Zend_Controller_Front::getInstance(); $frontend->setParam('noViewRenderer', true); $frontend->setParam('noErrorHandler', false); //lets route for the system routes $router = $frontend->getRouter(); $router->addConfig($routes); //lets add the controllers $frontend->setControllerDirectory(array('default' => APPL_PATH . $dirs['structure']['controllers'] . DIR_SEP . 'frontend', 'admin' => APPL_PATH . $dirs['structure']['controllers'] . DIR_SEP . 'backend')); //read the addons file $controllers = getControllers($dirs, $addons); $modules = getModules($dirs, $modules); $widgets = getWidgets($dirs, $widgets); //now register the controllers for these addons foreach ($controllers as $k => $v) { $frontend->addControllerDirectory(APPL_PATH . $v, $k); } //also add the routes foreach addon foreach ($controllers as $k => $v) { $addonRoutes = new Zend_Config_Xml(APPL_PATH . $dirs['structure']['addons'] . DIR_SEP . $k . DIR_SEP . 'routes.xml'); $router->addConfig($addonRoutes); } //also add the routes for the admin backend $router->addConfig(new Zend_Config_Xml(APPL_PATH . $dirs['structure']['controllers'] . DIR_SEP . 'backend' . DIR_SEP . 'routes.xml')); //attach the router to the frontend $frontend->setRouter($router); //we will be setting some registry values here //set the config
<?php require 'Logic/widget.php'; require 'Logic/afiliado.php'; $usuario_core->validateUser(); $usuario_core->hasAdminAccess('widgets'); $afiliado = getAfiliadoByIdUsuario($usuario_core->getUsuario()->id); $widgets = getWidgets($afiliado->id); $smarty->assign('widgets', $widgets); $smarty->assign('afiliado', $afiliado); $smarty->display('admin/widget/lista.tpl');