当前位置:懂科普 >

综合知识

> yiI怎么写

yiI怎么写

1. yii框架添加之后跳转列表地址怎么写

你是说,添加数据成功后跳转到列表页面

yiI怎么写

如果是的话,比如ArticleController里面的

public function actionAdd(){

$model = new Article();

$model->title = '';

..

if ($model->save()){

return $this->redirect(Url::toRoute('/article/list'));

}

}

public function actionList(){

echo 'list of articles';

}

我在Yii2写的,yii1.*的就不太记得了,估计差不多

2. yii1.1.16怎样写入口文件

<?php//应用根目录绝对路径define('ROOT_PATH', str_replace("", '/', dirname(__FILE__)));//当前环境(dev:开发环境,prod:生产环境)define('WY_ENV', 'dev');//是否开启 YII 调试模式define('YII_DEBUG', true);//加载配置文件$__cfg__ = require(ROOT_PATH . '/protected/config/main.php');//环境初始化require(ROOT_PATH . '/protected/init.php');//YII 框架的路径define('YII_ROOT', ROOT_PATH . '/yii');//加载 YII 框架文件require(YII_ROOT . '/yii.php');//创建并启动应用Yii::createWebApplication($__cfg__)->run();。

标签: yiI
  • 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/zonghezhishi/nyv4jj.html