zoukankan      html  css  js  c++  java
  • yii2 redirect重定向

    redirect使用方法

    $this->redirect(array('/site/contact','id'=>12));
    //http://www.kuitao8.com/testwebap/index.php?r=site/contact&id=12
     
    $this->redirect(array('site/contact','id'=>'idv','name'=>'namev'));
    //http://www.kuitao8.com/testwebap/index.php?r=site/contact&id=idv&name=namev
     
    $this->redirect(array('site/contact','v1','v2','v3'));
    //http://www.kuitao8.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3
     
    $this->redirect(array('site/contact','v1','v2','v3','#'=>'ttt'));
    //带anchor的  http://www.kuitao8.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3#ttt

    跳转到一个绝对路径

    $this->redirect('http://www.baidu.com');
  • 相关阅读:
    第十次作业
    第八次作业
    作业七--1
    作业五
    作业六
    作业四
    作业一
    作业三
    作业2
    jsp第一次作业
  • 原文地址:https://www.cnblogs.com/niuben/p/10721037.html
Copyright © 2011-2022 走看看