12.07.2015 Views

My first symfony project - Mesurex

My first symfony project - Mesurex

My first symfony project - Mesurex

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>My</strong> <strong>first</strong> <strong>symfony</strong> <strong>project</strong> 17$ php <strong>symfony</strong> generate:app backend$ php <strong>symfony</strong> propel:init-admin backend post BlogPost$ php <strong>symfony</strong> propel:init-admin backend comment BlogCommentListing1-41This time, we use the admin generator 18 . It offers much more features and customizationthan the basic CRUD generator.Just like you did for the frontend application, edit the layout (apps/backend/templates/layout.php) to add global navigation:Listing1-42You can access your new back-office application in the development environment by calling:http://localhost/sf_sandbox/web/backend_dev.php/postListing1-43The great advantage of the generated admin is that you can easily customize it by editing aconfiguration file.Change the sf_sandbox/apps/backend/modules/post/config/generator.yml to:generator:class:sfPropelAdminGeneratorparam:model_class: BlogPosttheme:defaultfields:title: { name: Title }excerpt: { name: Excerpt }body: { name: Body }nb_comments: { name: Comments }created_at: { name: Creation date }list:title:Post listlayout:tabulardisplay: [=title, excerpt, nb_comments, created_at]object_actions:_edit: ~Listing1-4418. http://www.<strong>symfony</strong>-<strong>project</strong>.org/book/1_2/14-Generators----------------- Brought to you by

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!