開発環境インストール
- vagrant
API作成
公式ドキュメントによる指針
http://ec-cube.github.io/api.html
Controllerにて
return $app->json(array('hoge'=>'fuga'), 200);
などでjsonを返せる
$app->jsonメソッドはSilexにて実装されている。
- その他プラグインで作成 https://github.com/EC-CUBE/eccube-api
Symfony2とEccube3ってどこが違うのか?
Symfony2 demoのsrc/AppBundleにBundleがある。
それらにその他バンドルのフォルダを追加したものがsrc/Eccube
比較
symfony2 demo
Eccube3
プラグイン、機能追加は?
独自サイトのためにイジる時
Eccubeフォルダ内をいじる
pluginの形で作る(配布可能になる)
SNS認証機能は?
- API authorization http://ec-cube.github.io/api_authorization.html
node.js
php(symfony)
などの例がある
エンドポイント(twitterの場合)
https://dev.twitter.com/oauth/3-legged
POST oauth2 / token
GET oauth/authorize