ลง yii ไม่อยาก ไม่กี่นาทีก็ได้โครงของโปรเจคแล้ว
- โหลดตัว framework มาก่อนจาก yiiframework
- แตกไฟล์ใส่ htdocs folder ของผมอยู่ที่ D:\xampp\htdocs (ปกติคือ C:\xampp\htdocs)
- ถ้าแตกไฟล์เก็บไว้ใน folder D:\xampp\htdocs\yii1 เปิด command พิมพ์
- d: กด enter
- พิมพ์ cd D:\xampp\htdocs\yii1\framework กด enter
- สร้าง Skeleton Application ถ้าต้องการสร้าง project ชื่อ JumpFlower (คืออะไรหาได้ใน google) เก็บที่ D:\xampp\htdocs\yii1\JumpFlower พิมพ์[code language=”text”]yiic webapp <b>D:\xampp\htdocs\yii1\JumpFlower[/code] แล้ว enter ตอบ yes รอจนขึ้นข้อความ “your application has been create successfully under …”
- เปิดไฟล์ D:\xampp\htdocs\yii1\JumpFlower\protected\config\database.php แก้ เอา comment ออก ใส่ชื่อ database username password ใม่ตามที่ใช้จริง[code language=”php”]<?php
// This is the database connection configuration.
return array(
‘connectionString’ => ‘sqlite:’.dirname(__FILE__).’/../data/testdrive.db’,
‘connectionString’ => ‘mysql:host=localhost;dbname=yii1′,
’emulatePrepare’ => true,
‘username’ => ‘root’,
‘password’ => ”,
‘charset’ => ‘utf8’,
‘tablePrefix’=>’tbl_’,
);[/code]
เสร็จ!
About the author