fuelphp事始め
mod_rewrite
public/.htaccessを変更すること(index.php)排除のため
RewriteBase /path/to/fuelphp
nginxで横にプロジェクトが並びまくる弊社環境の場合、いちいちrewriteやってられないので
ダサいけどindex.phpは必須。config.phpをいじって対応になりそう。この辺り
/** * index_file - The name of the main bootstrap file. * * Set this to 'index.php if you don't use URL rewriting */ 'index_file' => false,
ですね。
controller
最小構成のcontroller
class Controller_Hello extends Controller { function action_index() { //return "hellow world"; $data = array(); $data['hoge'] = 'aaaaa' $view = View::forge('hoge',$data); return $view; } }
viewは
@fuel/app/views/hoge.php
で
上位プログラムのログイン情報とか
今回のプロジェクトは既存サイトの配下にありますね。
before()とか使ってそこでなんとかすれば良さそう。
ごりっっとrouter()
とか書いて必要な機能を実行させるのも面白そう。
されど。。それはコントローラー層なのだろうか?model層で何とかスべきかもとは思う。