当前位置: 首页>>代码示例>>PHP>>正文


PHP Response::setRedirect方法代码示例

本文整理汇总了PHP中Response::setRedirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::setRedirect方法的具体用法?PHP Response::setRedirect怎么用?PHP Response::setRedirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Response的用法示例。


在下文中一共展示了Response::setRedirect方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     Session::start();
     Session::unregister();
     Response::setRedirect('/ingresar');
 }
开发者ID:joksnet,项目名称:php-old,代码行数:7,代码来源:Salir.php

示例2: testSetRedirectEmpty

 public function testSetRedirectEmpty()
 {
     $response = new Response();
     try {
         $response->setRedirect('');
         $this->fail();
     } catch (\InvalidArgumentException $expected) {
     }
 }
开发者ID:purchased-at,项目名称:sdk-php,代码行数:9,代码来源:ResponseTest.php

示例3: submit

 public function submit()
 {
     list($this->validationFlag, $this->validation) = Validation::check(array('nombre' => 'required'));
     if ($this->validationFlag) {
         $nombre = Request::getPost('nombre');
         Db::insert('empresas', array('nombre' => $nombre, 'fecha_creacion' => time()));
         Response::setRedirect('/personas');
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:9,代码来源:EmpresasAgregar.php

示例4: submit

 public function submit()
 {
     list($this->validationFlag, $this->validation) = Validation::check(array('nombre' => 'required', 'apellido' => 'required'));
     if ($this->validationFlag) {
         $nombre = Request::getPost('nombre');
         $apellido = Request::getPost('apellido');
         $correo = Request::getPost('correo');
         $cargo = Request::getPost('cargo');
         Db::insert('personas', array('id_empresas' => $this->idEmpresas, 'nombre' => $nombre, 'apellido' => $apellido, 'correo' => $correo, 'cargo' => $cargo, 'fecha_creacion' => time()));
         Response::setRedirect("/empresas/{$this->idEmpresas}/personas");
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:12,代码来源:EmpresasPersonasAgregar.php

示例5: submit

 public function submit()
 {
     $this->usuario = Request::getPost('usuario');
     $this->contrasena = md5(Request::getPost('contrasena'));
     $this->recordar = Request::getPost('recordar', 0);
     list($this->validationFlag, $this->validation) = Validation::check(array('usuario' => 'required', 'contrasena' => 'required'));
     if ($this->validationFlag) {
         $idPersonas = Db::one("SELECT personas.id_personas\n                   FROM personas\n                  WHERE personas.usuario = '{$this->usuario}'\n                    AND personas.contrasena = '{$this->contrasena}'\n                  LIMIT 1");
         if ($idPersonas) {
             Session::unregister();
             Session::register($this->usuario, $this->contrasena, $this->recordar == 1);
             Response::setRedirect('/');
         }
         $this->validationFlag = false;
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:16,代码来源:Ingresar.php

示例6: submit

 public function submit()
 {
     if (Request::hasPost('guardar')) {
         list($this->validationFlag, $this->validation) = Validation::check(array('nombre' => 'required', 'apellido' => 'required'));
         if ($this->validationFlag) {
             $nombre = Request::getPost('nombre');
             $apellido = Request::getPost('apellido');
             $correo = Request::getPost('correo');
             $cargo = Request::getPost('cargo');
             $telOficina = Request::getPost('tel_oficina');
             $telOficinaInt = Request::getPost('tel_oficina_int');
             $telCelular = Request::getPost('tel_celular');
             $telFax = Request::getPost('tel_fax');
             $telCasa = Request::getPost('tel_casa');
             Db::update('personas', array('nombre' => $nombre, 'apellido' => $apellido, 'correo' => $correo, 'cargo' => $cargo, 'tel_oficina' => $telOficina, 'tel_oficina_int' => $telOficinaInt, 'tel_celular' => $telCelular, 'tel_fax' => $telFax, 'tel_casa' => $telCasa, 'fecha_modificacion' => time()), "id_personas = '{$this->idPersonas}'");
             Response::setRedirect("/personas/{$this->idPersonas}");
         }
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:19,代码来源:PersonasEditar.php

示例7: submit

 public function submit()
 {
     if (Request::hasPost('guardar')) {
         list($this->validationFlag, $this->validation) = Validation::check(array('nombre' => 'required'));
         if ($this->validationFlag) {
             $nombre = Request::getPost('nombre');
             $direccion1 = Request::getPost('direccion_1');
             $direccion2 = Request::getPost('direccion_2');
             $ciudad = Request::getPost('ciudad');
             $estado = Request::getPost('estado');
             $codPostal = Request::getPost('cod_postal');
             $idPaises = Request::getPost('id_paises');
             $web = Request::getPost('web');
             $telOficina = Request::getPost('tel_oficina');
             $telFax = Request::getPost('tel_fax');
             Db::update('empresas', array('nombre' => $nombre, 'direccion_1' => $direccion1, 'direccion_2' => $direccion2, 'ciudad' => $ciudad, 'estado' => $estado, 'cod_postal' => $codPostal, 'id_paises' => $idPaises, 'web' => $web, 'tel_oficina' => $telOficina, 'tel_fax' => $telFax, 'fecha_modificacion' => time()), "id_empresas = '{$this->idEmpresas}'");
             Response::setRedirect("/empresas/{$this->idEmpresas}");
         }
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:20,代码来源:EmpresasEditar.php

示例8: testSetRedirect

 /** @dataProvider provideSetRedirect */
 public function testSetRedirect($expected, $url, $state = null, $error = null, $error_description = null, $error_uri = null)
 {
     $response = new Response();
     $response->setRedirect(301, $url, $state, $error, $error_description, $error_uri);
     $this->assertEquals($expected, $response->headers->get('Location'));
 }
开发者ID:Insantani,项目名称:SourceTree-diovi,代码行数:7,代码来源:ResponseTest.php

示例9: actionPost

 public function actionPost()
 {
     $response = new Response();
     return $response->setRedirect('/404.html');
 }
开发者ID:dekmabot,项目名称:dezen-framework,代码行数:5,代码来源:Controller.php

示例10: updateDoctorPoolInfo

 public function updateDoctorPoolInfo($request, Response $response)
 {
     /*{{{*/
     $spaceId = $request->spaceuserid;
     $params = array();
     $params['allowAnswerDayNumber'] = $request->dayNumber;
     $params['allowAnswerTodayRemainNumber'] = $request->TodayRemainNumber;
     $params['todayRecommend'] = $request->TodayRecommend;
     $spacePoolinfo = DAL::get()->find('SpaceModuleCase', $spaceId);
     if (!$spacePoolinfo->isNull()) {
         DZoneClient::getInstance()->updateSpacePoolInfo($spaceId, $this->curInspector->user->id, $params);
         //更新问题池限制信息
     }
     $response->setRedirect($response->router->urlfor('threadcate/recommendAuditDetail', array('space_user_id' => $spaceId, 'poolInfo' => '更新成功!', 'spaceuserid' => $spaceId)));
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:15,代码来源:threadcatecontroller.php

示例11: redirectIdioma

 public static function redirectIdioma($idioma)
 {
     Response::setRedirect(Url::make($idioma));
 }
开发者ID:joksnet,项目名称:php-old,代码行数:4,代码来源:Url.php

示例12: _redirect

 protected function _redirect($url)
 {
     $this->_response->setRedirect($url);
 }
开发者ID:RobertCar,项目名称:RobertCarrential,代码行数:4,代码来源:Controller.php

示例13: __construct

 public function __construct()
 {
     if (!Session::isLogin()) {
         Response::setRedirect('/ingresar');
     }
 }
开发者ID:joksnet,项目名称:php-old,代码行数:6,代码来源:WebBase.php


注:本文中的Response::setRedirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。