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

はじめよう CakePHP3

はじめよう CakePHP3

PHP Framework 最新バージョン使ってみた LT で CakePHP3で話しました。

http://connpass.com/event/16016/

Kenya Yamaguchi

June 19, 2015
Tweet

More Decks by Kenya Yamaguchi

Other Decks in Technology

Transcript

  1. CakePHP3 Λ͙࢝͢ΊΔ؀ڥߏங ※ Vagrant + VirturlBox ղΒͳ͍ਓ OR ஍Ͱߦ͖͍ͨਓ PHP

    5.4.16 Ҏ্ HTTP Server (Apache, Nginx) mbstring extension intl extension composer ͷΠϯετʔϧ
  2. CakePHP3 Λ͙࢝͢ΊΔ؀ڥߏங ※Vagrant + VirturlBox Λগ͠͸ղΔ FriendsOfCake/vagrant-chef GitHub (https://github.com/FriendsOfCake/vagrant-chef) Cakebox

    GitHub (https://github.com/alt3/cakebox) ؛ా͞Μ͕ Cakebox ʹ͍ͭͯ঺հ͞Ε͍ͯΔهࣄ
 http://blog.open.tokyo.jp/2015/04/19/cakebox-is-awesome.html
  3. ֤σΟϨΫτϦ sandboxs ᵓᴷᴷ README.md ᵓᴷᴷ bin ᵓᴷᴷ composer.json ᵓᴷᴷ config

    (֤छઃఆϑΝΠϧ) ᵓᴷᴷ index.php ᵓᴷᴷ logs (ϩά֨ೲ) ᵓᴷᴷ phpunit.xml.dist ᵓᴷᴷ plugins ᵓᴷᴷ src ᵓᴷᴷ tests ᵓᴷᴷ tmp ᵓᴷᴷ vendor
  4. ىಈͯ͠ΈΔ λʔϛφϧ͔ΒԼهͷίϚϯυΛ࣮ߦ > bin/cake server --------------------------------------------------------------- App : src Path:

    /var/www/sandbox/src/ DocumentRoot: /var/www/sandbox/webroot --------------------------------------------------------------- built-in server is running in http://localhost:8765/ You can exit with `CTRL-C` ϒϥ΢βͰԼهͷ URL ʹΞΫηε > http://localhost:8765/
  5. Controller namespace App\Controller; use Cake\Network\Exception\NotFoundException; class NipposController extends AppController {

    // ΞΫγϣϯ public function add() { // ॲཧίʔυ } // ඇΞΫγϣϯ public function __logic() { // ॲཧίʔυ } }
  6. Model namespace App\Model\Table; use Cake\ORM\Table; class NipposTable extends Table {

    public function initialize(array $config) { // ॲཧίʔυ } }