SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Symfony1 Admin Generator
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

Weitere ähnliche Inhalte

Ähnlich wie Symfony Admin Generator - generator.yml

DJango admin interface
DJango admin interfaceDJango admin interface
DJango admin interfaceMahesh Shitole
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16Vivek chan
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5Mahmoud Ouf
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes ramakesavan
 
Data controls ppt
Data controls pptData controls ppt
Data controls pptIblesoft
 
AIA101.3.Access Reports And Forms
AIA101.3.Access Reports And FormsAIA101.3.Access Reports And Forms
AIA101.3.Access Reports And FormsDan D'Urso
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercisesddrschiw
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorialonlinetrainingplacements
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechMandakini Kumari
 
C++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsC++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsTawnaDelatorrejs
 
Django tech-talk
Django tech-talkDjango tech-talk
Django tech-talkdtdannen
 
phpWebApp presentation
phpWebApp presentationphpWebApp presentation
phpWebApp presentationDashamir Hoxha
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentationsasidhar
 

Ähnlich wie Symfony Admin Generator - generator.yml (20)

Actionview
ActionviewActionview
Actionview
 
DJango admin interface
DJango admin interfaceDJango admin interface
DJango admin interface
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Jazz
JazzJazz
Jazz
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Oracle report from ppt
Oracle report from pptOracle report from ppt
Oracle report from ppt
 
Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes Drupal 7 Theming - Behind the scenes
Drupal 7 Theming - Behind the scenes
 
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
 
AIA101.3.Access Reports And Forms
AIA101.3.Access Reports And FormsAIA101.3.Access Reports And Forms
AIA101.3.Access Reports And Forms
 
Custom PrimeFaces components
Custom PrimeFaces componentsCustom PrimeFaces components
Custom PrimeFaces components
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercises
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorial
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotech
 
C++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsC++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment Instructions
 
Django tech-talk
Django tech-talkDjango tech-talk
Django tech-talk
 
phpWebApp presentation
phpWebApp presentationphpWebApp presentation
phpWebApp presentation
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
 

Kürzlich hochgeladen

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 

Kürzlich hochgeladen (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Symfony Admin Generator - generator.yml

  • 2.
  • 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); }