יום חמישי, 6 ביוני 2013

simple yii

After unpacking the yii-1.1.13.e9e4a0.zip file into the C:\Program Files\Zend\Apache2\htdocs directory I had notice the hello world sample in the demos directory:
C:\Program Files\Zend\Apache2\htdocs\yii\demos\helloworld
I lunch it using :
http://localhost/yii/demos/helloworld/index.php
And Walla :
Capture24
The code is very trivial:
The index.php file that inits the Yii bootstrap
and create and run the web application

  1: <?php
  2: 
  3: // include Yii bootstrap file
  4: require_once(dirname(__FILE__).'/../../framework/yii.php');
  5: 
  6: // create a Web application instance and run
  7: Yii::createWebApplication()->run();

The controller :SiteController.php that override the default actionIndex method


  1: <?php
  2: 
  3: /**
  4:  * SiteController is the default controller to handle user requests.
  5:  */
  6: class SiteController extends CController
  7: {
  8: 	/**
  9: 	 * Index action is the default action in a controller.
 10: 	 */
 11: 	public function actionIndex()
 12: 	{
 13: 		echo 'Hello World';
 14: 	}
 15: }

אין תגובות:

הוסף רשומת תגובה