Blog

読了『はじめてのフレームワークとしての FuelPHP』

http://tatsu-zine.com/books/fuelphp1st
FuelPHP は codeigniter に関わっていた人らもかかわっているということで、CodeIgniter 的なうすいかんじでいいものにしあがってる感じをうけた。

テンプレートでの自動エスケープがちょっとおもしろい。Xslate とかの方がぬけることがなさそうではあるけれど。

class Controller_Example extends Controller
{

    public function action_index()
    {
        $view = \View::forge('example');

        // add it unfiltered just like you added
        // フィルタされて出力される: <strong>not bold because filtered</strong>
        $view->title = '<strong>not bold because filtered</strong>';

        // フィルタしないで追加する
        $view->set('title', '<strong>not bold because filtered</strong>', false);

        // or use the set_safe() method, which is identical to set() but defaults to 'false'
        $view->set_safe('title', '<strong> bold because unfiltered</strong>');

        return $view;
    }
}