public function __construct() { parent::__construct(); $this->_rules = array(); $this->_errors = array(); $this->input = Registry::get('input'); }
/** * Create a template instance to allow parsing of templates * @param array $options */ public function __construct($options = array()) { parent::__construct($options); Event::fire("framework.view.construct.before", array($this->file)); $this->_template = new Template(array("implementation" => new Template\Implementation\Extended())); Event::fire("framework.view.construct.after", array($this->file, $this->template)); }
public function __construct() { parent::__construct(); $this->session = Registry::get('session'); $this->cookie = Registry::get('cookie'); $this->input = Registry::get('input'); $this->validator = Registry::get('validator'); }
public function __construct($options = array()) { parent::__construct(); $smtpClient = new MailClient(); $smtpClient->setServer($this->server, $this->port, $this->security); $smtpClient->setSender($this->from, $this->from, $this->_password); $smtpClient->setMail($options["to"], $options["subject"], $options["body"], $contentType = "text/html"); $smtpClient->sendMail(); }
public function __construct() { parent::__construct(); $this->database = Registry::get('database'); if ($this->database !== null) { $this->database->connect(); } $this->session = Registry::get('session'); $this->cookie = Registry::get('cookie'); $this->input = Registry::get('input'); }
public function __get($name) { preg_match('#_txt$#', $name, $matches); if (count($matches) == 1) { if (isset($this->{$name})) { return $this->{$name}; } else { throw new Exception('No string in xml language file'); } } else { parent::__get($name); } }
/** * It defines the location of the layout template, which is passed to the new View instance, which is then passed into the setLayoutView() setter method. * It gets the controller/action names from the router. It gets the router instance from the registry, and uses getters for the names. * It then builds a path from the controller/action names, to a template it can render. * @param type $options */ public function __construct($options = array()) { parent::__construct($options); Events::fire("framework.controller.construct.before", array($this->name)); $router = Registry::get("router"); switch ($router->getExtension()) { case "json": $this->defaultContentType = "application/json"; $this->defaultExtension = $router->getExtension(); break; default: break; } $this->setLayout(); Events::fire("framework.controller.construct.after", array($this->name)); }
public function __construct($options = array()) { parent::__construct($options); if ($this->getWillRenderLayoutView()) { $defaultPath = $this->getDefaultPath(); $defaultLayout = $this->getDefaultLayout(); $defaultExtension = $this->getDefaultExtension(); $view = new View(array('file' => APP_PATH . "\\{$defaultPath}\\{$defaultLayout}.{$defaultExtension}")); $this->setLayoutView($view); } if ($this->getWillRenderActionView()) { $router = Registry::get('router'); $controller = $router->getController(); $action = $router->getAction(); $view = new View(array('file' => APP_PATH . "\\{$defaultPath}\\{$controller}\\{$action}.{$defaultExtension}")); $this->setActionView($view); } }
/** * [__construct description] * @param array $options [description] */ public function __construct($options = array()) { parent::__construct($options); Event::fire("framework.controller.construct.before", array($this->name)); // Get layout location and pass to View instance if ($this->willRenderLayoutView) { $defaultPath = $this->defaultPath; $defaultLayout = $this->defaultLayout; $defaultExtension = $this->defaultExtension; $view = new View(array("file" => path('app') . "{$defaultPath}/{$defaultLayout}.{$defaultExtension}")); $this->setLayoutView($view); } if ($this->willRenderActionView) { $router = Registry::get("router"); $controller = $router->controller; $action = $router->getAction(); $view = new View(array("file" => path('app') . "{$defaultPath}/{$controller}/{$action}.{$defaultExtension}")); $this->setActionView($view); } Event::fire("framework.controller.construct.after", array($this->name)); }
/** * Split HTTP response string into headers and body * @param array $options */ public function __construct($options = array()) { if (!empty($options['response'])) { $response = $this->_response = $options['response']; unset($options['response']); } parent::__construct($options); $pattern = '#HTTP/\\d\\.\\d.*?$.*?\\r\\n\\r\\n#ims'; preg_match_all($pattern, $response, $matches); $headers = array_pop($matches[0]); $headers = explode("\r\n", str_replace("\r\n\r\n", "", $headers)); $this->_body = str_replace($headers, "", $response); $version = array_shift($headers); preg_match('#HTTP/(\\d\\.\\d)\\s(\\d\\d\\d)\\s(.*)#', $version, $matches); $this->_headers['Http-version'] = $matches[1]; $this->_headers['Status-Code'] = $matches[2]; $this->_headers['Status'] = $matches[2] . " " . $matches[3]; foreach ($headers as $header) { preg_match('#(.*?)\\:\\s(.*)#', $header, $matches); $this->_headers[$matches[1]] = $matches[2]; } }
public function __construct($options = array()) { parent::__construct($options); $this->agent = RequestMethods::server("HTTP_USER_AGENT", "Curl/PHP " . PHP_VERSION); }
public function __construct(PDO $pdo, $type, $options = array()) { parent::__construct($options); $this->_type = $type; $this->_pdo = $pdo; }
public function __construct($options = array()) { parent::__construct($options); $this->_template = new Template(array('implementation' => new Template\Implementation\Extended())); }
public function __construct() { parent::__construct(); }
public function __construct($options = array()) { parent::__construct($options); }
public function __construct($options = array()) { parent::__construct($options); $options_view = array(); if ($this->getWillRenderLayoutView()) { $defaultPath = $this->getDefaultPath(); $defaultLayout = $this->getDefaultLayout(); $defaultExtension = $this->getDefaultExtension(); $options_view["file"] = APP_PATH . "/{$defaultPath}/{$defaultLayout}.{$defaultExtension}"; } if ($this->getWillRenderActionView()) { $router = Registry::get("router"); $controller = $router->getController(); $action = $router->getAction(); $options_view["actionFile"] = APP_PATH . "/{$defaultPath}/{$controller}/{$action}.{$defaultExtension}"; // $this->setActionView($view); } $view = new View($options_view); $this->setLayoutView($view); $this->setActionView($view); }
public function __construct() { parent::__construct(); @session_start(); }
public function __construct($options = array()) { parent::__construct($options); $this->load(); }
public function __construct($options = array()) { parent::__construct($options); $this->checkRecordOffset(); $this->setTotalPages(); $this->calculateCurrentPage(); $this->createInactiveSpans(); $this->calculateCurrentStartPage(); $this->calculateCurrentEndPage(); }