ビューにSmartyを導入、かといってコントローラで

$this->load->library('smarty_parser');

とライブラリを毎回読んであげるは面倒・・・・・


ってことで


config/autoload.phpを編集し自動で呼び出すライブラリを設定


以下その内容でごわす。

*/

/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your system/application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

//$autoload['libraries'] = array();

$autoload['libraries'] = array('database', 'session', 'xmlrpc','smarty_parser');



太字の一行を追加。
これで配列に入っているライブラリのクラスを読み出すことができますた!

application/config/routes.phpファイルを編集


$route['default_controller'] = 'コントローラー名';


通常のコントローラとメソッドを指定するようなURI が表されて

いないときに、このコントローラーが呼ばれます。

リファレンスにありましたが、自分の環境はXAMPPを使用しているため

サブディレクトリの中にCIを設置しています。


[ci](CodeIgniter本体)
├[system]
├[user_guide]
├index.php

.htaccess
└license.txt

htaccessの設定を以下に変更


RewriteEngine on
RewriteCond $1 !^(index\.php|js|css|img|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]