Ejemplo n.º 1
0
 /**
  * @param string $value
  */
 public function set_language($value)
 {
     if (Request::get_var('language')) {
         setcookie('language', $value, strtotime('+10 years'), '/');
     } else {
         $this->set_params(['language' => $value], 'configuration');
     }
 }
Ejemplo n.º 2
0
 /**
  * @param string $name
  * @param string $filter
  * @param string $default
  * @param string $expected
  * @covers common\classes\Request::get_var
  * @dataProvider get_var_provider
  */
 public function test_get_var($name, $filter, $default, $expected)
 {
     self::assertEquals($expected, Request::get_var($name, $filter, $default));
 }
Ejemplo n.º 3
0
 private function action_delete_user()
 {
     /**
      * @var $user \User
      */
     $user = Application::get_class(\User::class);
     $mapper = $user->get_mapper();
     $mapper->delete($mapper->find_by_id(Request::get_var('id', 'int', 0)));
     $this->response->status = 'success';
     /**
      * @var $template \Starter
      */
     $template = Application::get_class(\Starter::class);
     /**
      * @var $lang_vars \ArrayAccess
      */
     $lang_vars = new LanguageFile('routers' . DS . 'router.json', $template->get_lang_path());
     $this->response->message = $lang_vars['messages']['user_deleted'];
 }