本文整理汇总了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');
}
示例2: testSetRedirectEmpty
public function testSetRedirectEmpty()
{
$response = new Response();
try {
$response->setRedirect('');
$this->fail();
} catch (\InvalidArgumentException $expected) {
}
}
示例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');
}
}
示例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");
}
}
示例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;
}
}
示例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}");
}
}
}
示例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}");
}
}
}
示例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'));
}
示例9: actionPost
public function actionPost()
{
$response = new Response();
return $response->setRedirect('/404.html');
}
示例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)));
}
示例11: redirectIdioma
public static function redirectIdioma($idioma)
{
Response::setRedirect(Url::make($idioma));
}
示例12: _redirect
protected function _redirect($url)
{
$this->_response->setRedirect($url);
}
示例13: __construct
public function __construct()
{
if (!Session::isLogin()) {
Response::setRedirect('/ingresar');
}
}