yiI怎麼寫
- 綜合知識
- 關注:1.55W次
1. 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://shqsg.com/zh-mo/zonghezhishi/lyn8kk.html