วันจันทร์ที่ 3 มิถุนายน พ.ศ. 2556
How To Install Extension Yii Bootstrap
1. หลังจากที่คุณ taqmaninw โหลดไฟล์มาเรียบร้อยแล้วให้แตกไฟล์ Zip ที่ตำแหน่ง protected/extensions/bootstrap ถ้าไม่มีไดเร็กทอรี่ชื่อ bootstrap ก็ให้สร้างขึ้นมาก่อน ถึงค่อยแตกไฟล์ลงไป
2. เพิ่มบรรทัดนี้ Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap'); ลงใน /protected/config/main.php ต้นบรรทัดเพื่อทำ Alias ตัวอย่างในไฟล์ main.php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
3. เพิ่มบรรทัดต่อไปนี้ เพิ่มเติมลงใน /protected/config/main.php ตัวอย่าง
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
'theme'=>'bootstrap', << ในกรณีใช้ Theme bootstrap อ่านต่อข้อ 4 ครับ
// preloading 'log' component
'preload'=>array('log'),
'charset'=>'utf-8',
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'Password',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
'generatorPaths' => array(
'bootstrap.gii'
),
),
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
.......
.......
4. คัดลอกทุกอย่างในไดเร็กทอรี่ protected/extensions/bootstrap/theme มันคือตำแหน่งที่คุณแตกไฟล์ในข้อ 1 ไปไว้ที่ themes/bootstrap ถ้าไม่มีไดเร็กทอรี่ชื่อ bootstrap ก็ให้สร้างขึ้นมาก่อน แล้วค่อยคัดลอก
หรือจะคัดลอก protected/extensions/bootstrap/theme ไปใส่ที่ themes/ แล้วค่อยเปลี่ยนชื่อเป็น bootstrap ก็ได้ครับ
สมัครสมาชิก:
บทความ (Atom)