SlideShare a Scribd company logo
Symfony1 Admin Generator
Symfony Admin Generator - generator.yml
Format generator.yml
●

●

By default, the columns of the list view are the columns defined in
schema.yml.
The fields of the new and edit views are the one defined in the
form associated with the model. With generator.yml, you can
choose which fields are displayed (display: []), add fields of your own
Ex:

//Column followed with ( “_”) will display the
partial template, usually a file like _currency_pair.php .
display: [_currencyPair, ...]

//Column followed with ( “=”) will display
the column with anchor link (<a />) to edit the particular record.
display: [=currencyPair, ...]

display: [~article_link,

…] //Like class file, we have some thing like
components.class.php file, will include that.
(You may need to split a partial into a logic part and a presentation
part. In such a case, you should use a component).
fields:
status: { name: Is Active}
currency_id_pair: {name: Currency Pair ID}
campaign_point: {name: My Header}

View :
This is a general principle:
Any settings that are set for the whole module under the
fields key, can be overridden by view-specific areas. The
overriding rules are the following:

●

new and edit inherits from form which inherits from fields

●

list inherits from fields

●

filter inherits from fields
Setting a Custom Title, Content/Layout of view.
edit:
title: Edit Article %%currency_pair%% (%%campaign_currency_values_id%%)

Output:
http://xyz/admin_dev.php/abc/edit/campaign_currency_values_id/26
layout: stacked
params: |
%%=content%%<br />
(sent by %%author%% on %%created_at%% about %%article_link%%)
Setting a Default Sort Field in the list View
list:
sort:

created_at

## Alternative syntax, to specify a sort order
sort:

[created_at, desc]

Customizing the Pagination:
config:
list:
max_per_page:

5
●

Using a Join to Speed Up Page Delivery
1.By default, the administration generator uses a simple
doSelect() to retrieve a list of records.
2. But, if you use related objects in the list, the number of
database queries required to display the list may rapidly increase.
Ex: If you want to display the name of the article in a list of
comments, an additional query is required for each post in the list
to retrieve the related Article object

●

So you may want to force the pager to use a doSelectJoinXXX()
method to optimize the number of queries.
config:
list:
peer_method: doSelectJoinArticle
Defining Interactions for Each View,
object_actions:
_edit:
_delete:

~
~

addcomment:

{ label: Add a comment, action: addComment }
●

Clicking it triggers a call to the addComment action in the
current module.

Ex:
http://xyz/admin_dev.php/abc/addComment/campaign_currency_valu
So need to implement the code :
public function executeAddComment($request) {
$comment = new Comment();
$comment->setArticleId($request->getParameter('id'));
$comment->save();
$this->redirect('comments_edit', $comment);
}
Questions
Symfony Admin Generator - generator.yml

More Related Content

PPTX
Templates, partials and layouts
PDF
Has Many And Belongs To Many
PDF
WCNC2015 - Options Pages for Themes and Plugins
PPTX
Mysql Aggregate
PPT
Basic Operation in Excel and Eviews
PPT
Advanced Drupal Views: Theming your View
PDF
RDBMS Lab02 creating tables (UIU)
PPT
Dynamic Web Pages Ch 8 V1.0
Templates, partials and layouts
Has Many And Belongs To Many
WCNC2015 - Options Pages for Themes and Plugins
Mysql Aggregate
Basic Operation in Excel and Eviews
Advanced Drupal Views: Theming your View
RDBMS Lab02 creating tables (UIU)
Dynamic Web Pages Ch 8 V1.0

Similar to Symfony Admin Generator - generator.yml (20)

PPS
Actionview
PPTX
DJango admin interface
PPTX
Intro to OctoberCMS
PPTX
WordPress Structure and Best Practices
PPTX
Asp Net Advance Topics
PPSX
11 asp.net session16
PDF
Intake 38 data access 5
DOC
Oracle report from ppt
PDF
Drupal 7 Theming - Behind the scenes
PPT
Data controls ppt
PPT
AIA101.3.Access Reports And Forms
PDF
Custom PrimeFaces components
PPTX
FSD MODULE 4 - Using Generic Views, Generic Views of Objects, Extending Gener...
PPT
XPages Workshop: Concepts And Exercises
DOCX
OBIEE publisher with Report creation - Tutorial
PPT
Drupal 7 theme by ayushi infotech
DOCX
C++ Programming Class Creation Program Assignment Instructions
ODP
Django tech-talk
PDF
phpWebApp presentation
Actionview
DJango admin interface
Intro to OctoberCMS
WordPress Structure and Best Practices
Asp Net Advance Topics
11 asp.net session16
Intake 38 data access 5
Oracle report from ppt
Drupal 7 Theming - Behind the scenes
Data controls ppt
AIA101.3.Access Reports And Forms
Custom PrimeFaces components
FSD MODULE 4 - Using Generic Views, Generic Views of Objects, Extending Gener...
XPages Workshop: Concepts And Exercises
OBIEE publisher with Report creation - Tutorial
Drupal 7 theme by ayushi infotech
C++ Programming Class Creation Program Assignment Instructions
Django tech-talk
phpWebApp presentation
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PPTX
Machine Learning_overview_presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A comparative analysis of optical character recognition models for extracting...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
Machine Learning_overview_presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25-Week II
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Ad

Symfony Admin Generator - generator.yml

  • 4. ● ● By default, the columns of the list view are the columns defined in schema.yml. The fields of the new and edit views are the one defined in the form associated with the model. With generator.yml, you can choose which fields are displayed (display: []), add fields of your own Ex: //Column followed with ( “_”) will display the partial template, usually a file like _currency_pair.php . display: [_currencyPair, ...] //Column followed with ( “=”) will display the column with anchor link (<a />) to edit the particular record. display: [=currencyPair, ...] display: [~article_link, …] //Like class file, we have some thing like components.class.php file, will include that. (You may need to split a partial into a logic part and a presentation part. In such a case, you should use a component).
  • 5. fields: status: { name: Is Active} currency_id_pair: {name: Currency Pair ID} campaign_point: {name: My Header} View :
  • 6. This is a general principle: Any settings that are set for the whole module under the fields key, can be overridden by view-specific areas. The overriding rules are the following: ● new and edit inherits from form which inherits from fields ● list inherits from fields ● filter inherits from fields
  • 7. Setting a Custom Title, Content/Layout of view. edit: title: Edit Article %%currency_pair%% (%%campaign_currency_values_id%%) Output: http://xyz/admin_dev.php/abc/edit/campaign_currency_values_id/26
  • 8. layout: stacked params: | %%=content%%<br /> (sent by %%author%% on %%created_at%% about %%article_link%%)
  • 9. Setting a Default Sort Field in the list View list: sort: created_at ## Alternative syntax, to specify a sort order sort: [created_at, desc] Customizing the Pagination: config: list: max_per_page: 5
  • 10. ● Using a Join to Speed Up Page Delivery 1.By default, the administration generator uses a simple doSelect() to retrieve a list of records. 2. But, if you use related objects in the list, the number of database queries required to display the list may rapidly increase. Ex: If you want to display the name of the article in a list of comments, an additional query is required for each post in the list to retrieve the related Article object ● So you may want to force the pager to use a doSelectJoinXXX() method to optimize the number of queries. config: list: peer_method: doSelectJoinArticle
  • 11. Defining Interactions for Each View, object_actions: _edit: _delete: ~ ~ addcomment: { label: Add a comment, action: addComment }
  • 12. ● Clicking it triggers a call to the addComment action in the current module. Ex: http://xyz/admin_dev.php/abc/addComment/campaign_currency_valu So need to implement the code : public function executeAddComment($request) { $comment = new Comment(); $comment->setArticleId($request->getParameter('id')); $comment->save(); $this->redirect('comments_edit', $comment); }