Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FuelPHP をさわってみて #phpkansai

omoon
May 17, 2012

FuelPHP をさわってみて #phpkansai

PHPカンファレンス関西2012 のセッションで使ったスライドです。

omoon

May 17, 2012
Tweet

More Decks by omoon

Other Decks in Technology

Transcript

  1. PJM

  2. #!/bin/bash PREFIX="/usr/bin/" install_oil() { sudo sh -c "curl --silent http://get.fuelphp.com/

    installer.sh > ${PREFIX}oil" sudo chmod +x ${PREFIX}oil } # # Handle execution # main() { # Start installation install_oil exit 0 } main
  3. #!/bin/bash if [ -f "./oil" ]; then php oil "$@"

    else if [ "$1" == "create" ]; then if [ ! `which git` ]; then echo "For this installer to work you'll need to install Git." echo ' http://git-scm.com/' fi git clone --recursive git://github.com/fuel/ fuel.git "./$2" php "./$2/oil" refine install else echo 'This is not a valid Fuel installation so Oil is a bit lost.' echo ' http://fuelphp.com/docs/ installation/instructions.html' fi fi
  4. .7$

  5. .

  6. 7

  7. $

  8. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } } QSFpYFEXJUI$POUSPMMFS@
  9. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } } TIPVMEFYUFOEUIF$POUSPMMFSDMBTT
  10. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } } BDUJPO@
  11. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } } "DPOUSPMMFSBDUJPO.645SFUVSO B3FTQPOTFPCKFDU
  12. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } } IUUQMPDBMIPTUCMPHQVCMJDXFMDPNFJOEFY
  13. class Controller_Welcome extends Controller { public function action_index() { return

    Response::forge(View::forge('welcome/index')); } public function action_hello() { return Response::forge( View::forge( 'welcome/hello', array('name' => $this->param('name', 'World')) ) ); } } IUUQMPDBMIPTUCMPHQVCMJDXFMDPNFIFMMP
  14. <?php return array( '_root_' => 'welcome/index', // The default route

    '_404_' => 'welcome/404', // The main 404 route 'hello(/:name)?' => array('welcome/hello'), );
  15. <?php return array( '_root_' => 'welcome/index', // The default route

    '_404_' => 'welcome/404', // The main 404 route 'hello(/:name)?' => array('welcome/hello'), );
  16. <?php return array( '_root_' => 'welcome/index', // The default route

    '_404_' => 'welcome/404', // The main 404 route 'hello(/:name)?' => array('welcome/hello'), );
  17. class Controller_Welcome extends Controller { public function action_hello() { return

    Response::forge( View::forge( 'welcome/hello', array('name' => $this->param('name', 'World')) ) ); } } IUUQMPDBMIPTUCMPHQVCMJDIFMMPQIQ
  18. class Controller_Welcome extends Controller { public function action_hello() { return

    Response::forge( View::forge( 'welcome/hello', array('name' => $this->param('name', 'World')) ) ); } } IUUQMPDBMIPTUCMPHQVCMJDIFMMPQIQ
  19. <body> <div id="header"> <div class="row"> <div id="logo"></div> </div> </div> <div

    class="container"> <div class="row"> <div class="span16"> <h1>Hello, <?php echo $name; ?>! < IUUQMPDBMIPTUCMPHQVCMJDIFMMPQIQ
  20. class Controller_Welcome extends Controller { public function action_hello() { return

    Response::forge( View::forge( 'welcome/hello', array('name' => $this->param('name', 'World')) ) ); } } IUUQMPDBMIPTUCMPHQVCMJDIFMMPQIQ
  21. <body> <div id="header"> <div class="row"> <div id="logo"></div> </div> </div> <div

    class="container"> <div class="row"> <div class="span16"> <h1>Hello, <?php echo $name; ?>! < IUUQMPDBMIPTUCMPHQVCMJDIFMMPQIQ
  22. ஋ͷ౉͠ํͦͷ̍ $data = array('title' => 'hoge', 'contents' => 'fuga'); return

    Response::forge(View::forge('welcome/index', $data));
  23. class Controller_Test extends Controller_Rest { public function get_list() { $this->response(array(

    'foo' => Input::get('foo'), 'baz' => array( 1, 50, 219 ), 'empty' => null )); } } IUUQMPDBMIPTUUFTUMJTUʹHFU