Пример #1
0
 public function __construct($controller, $method)
 {
     try {
         if (!isset($_GET['url'])) {
             throw new \Exception("no esta definido el method get url");
         }
         $get = Sanitize::get('url');
         if (empty($get)) {
             $this->controller = $controller;
         } else {
             $this->controller = ucwords(array_shift($get));
         }
         if (empty($get)) {
             $this->method = $method;
             $this->default = $method;
         } else {
             $this->method = array_shift($get);
         }
         if (preg_match('/([\\-])/', $this->method)) {
             $xpl = explode('-', $this->method);
             $one = array_shift($xpl);
             $union = '';
             foreach ($xpl as $case) {
                 $union .= ucwords(mb_substr($case, 0, null, 'UTF-8'));
             }
             $this->method = $one . $union;
         }
         $this->args = $get;
         $this->file = '\\App\\Http\\Controllers\\' . $this->controller . 'Controller';
     } catch (DokerException $e) {
         die($e->getMessage());
     }
 }
Пример #2
0
 /**
  * @param $e escapar caracteres raros
  */
 protected function scape($e)
 {
     $e = Sanitize::string($e);
     $e = addslashes($e);
     return $e;
 }