public function __construct(\core\Request $request) { $this->_controller = $request->getController(); $this->_view = $request->getAction(); $objeto = new \core\Config(FILE_CONFIG_APP); $this->_config = $objeto->getConfig(); }
public function __construct() { $configFile = new \core\Config(FILE_CONFIG_APP); $configuration = $configFile->getConfig(); $request = new \core\Request(); $this->_view = new \core\View($request); $this->_view->title = ucwords($request->getAction()); }
protected function _getBackendMetadata($module) { $backendPath = __DIR__ . '/../../../etc/app/backend/'; $metadataPath = $backendPath . '/' . $module . '/metadata.json'; if (!file_exists($metadataPath)) { return; } $conf = new \core\Config($metadataPath); $metadata = $conf->read(); $metadata['name'] = $module; return $metadata; }
/** * Objeto que representa la peticion. * */ public function __construct() { try { $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); $url = explode('/', $url); $url = array_filter($url); $this->_controller = strtolower(array_shift($url)); $this->_action = strtolower(array_shift($url)); $this->_parameters = $url; $config = new \core\Config(FILE_CONFIG_APP); $ini = $config->getConfig(); if (!$this->_controller) { $this->_controller = $ini['application']['controllerDefault']; } if (!$this->_action) { $this->_action = $ini['application']['actionDefault']; } if (!isset($this->_parameters)) { $this->_parameters = array(); } } catch (Exception $ex) { throw $ex; } }
/** * Headers for email * * @return string */ private function headers() { $prTitle = $this->config->get('project_title'); $prEmail = $this->config->get('project_email'); return 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'From: ' . $prTitle . ' <' . $prEmail . '>' . "\r\n" . 'Reply-To: ' . $prTitle . ' <' . $prEmail . '>' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); }
public function executeDeleteRoute(\core\HTTPRequest $request) { $this->page()->addVar('title', 'Supprimer une route'); $this->_addBreadcrumb(); $routeApp = $request->getData('app'); $routeId = (int) $request->getData('id'); $configPath = __DIR__ . '/../../../etc/app/' . $routeApp . '/routes.json'; try { $conf = new \core\Config($configPath); $routes = $conf->read(); foreach ($routes as $id => $route) { if ($id == $routeId) { unset($routes[$id]); break; } } $conf->write($routes); } catch (\Exception $e) { $this->page()->addVar('error', $e->getMessage()); return; } $this->page()->addVar('deleted?', true); }