yii学习笔记

简介:这是yii学习笔记的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=333671' scrolling='no'>

主要参考地址http://www.yiiframework.com/doc/guide/1.1/zh_cn/

安装

1 首先是创建一个yii application

YiiRoot/framework/yiic webapp WebRoot/guavayii

2 复制framework到刚刚创建的application里面 之后把index.php的第4 5行改为 $yii=dirname(__FILE__).'/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';

3 输入相应的地址就可以访问了

控制器

1 copy一份protected\controllers\SiteController.php 到 GuavaController.php

class GuavaController extends Controller
{
	/**
	 * This is the default 'index' action that is invoked
	 * when an action is not explicitly requested by users.
	 */

	 //相关文档 http://www.yiiframework.com/doc/guide/1.1/zh_cn/basics.controller
	public function actionIndex($gu)
	public function actionIndex($gu,$language='en')
	{
		//$this->render('index');
		echo $gu.$language;
		echo "hello yii";
	}
}

访问http://127.0.0.1/guavayii/index.php?r=guava&gu=1&language=zh 就可以看到 1zhhello yii 了

“yii学习笔记”的更多相关文章 》

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/333671.html pageNo:11
原文地址:https://www.cnblogs.com/ooooo/p/2249293.html