0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Symfony2 Admin Bundleでテーブル作成から画面作成まで

Last updated at Posted at 2015-04-24

Code for Japanの合宿で、
急遽開発を担当することになったので、
Symfony2にて開発を行った。

自分で手を動かして開発するのは何年振りだろう。。。
間違ってたらごめんなさい。
地味に環境構築が大変。

あとで清書します。

Symfony2 をインストール

省略
※後程作成します。

Sonata Admin Bundleインストール

composer.json設定

Symfony2インストール直下のcomposer.jsonに以下を追記

   "require": {
        ・・・
        "sonata-project/core-bundle": "~2.3",
        "sonata-project/admin-bundle": "~2.3",
        "sonata-project/doctrine-orm-admin-bundle": "~2.3",
        "fresh/doctrine-enum-bundle": "~3.2"
        ・・・
    },

インストール

composer install

テーブル作成

DB管理ツールなどでテーブルを手動作成する。

Schemeファイル作成

app/console doctrine:mapping:import --force APPBundle yml

テーブルから作成しない場合、スキーマファイルを作成したのち、
以下の手順で、テーブルに反映を行う。

データベース作成

app/console doctrine:database:create

テーブル作成

app/console doctrine:schema:create

Entityクラスファイル作成

app/console doctrine:generate:entities APPBundle

管理画面作成

app/console sonata:admin:generate APPBundle/Entity

その他参考資料

DOCUMENTATION » ADMIN
https://sonata-project.org/bundles/admin/2-3/doc/index.html
Symfony2 Jobeet’s documentation 12. 12日目: Sonata Admin Bundle
http://jobeet.symfony.gr.jp/day-12-sonata-admin-bundle.html
The Web Mason
http://thewebmason.com/category/sonata-admin/
Symfony2 | Cristian Radulescu
http://cristian-radulescu.ro/category/programming/symfony2

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?