The document provides an overview of the Sonata AdminBundle. It introduces Thomas Rabaix, the lead developer, and describes how the bundle provides a backend generator for Symfony 2 that aims to create a consistent and rich user experience for managing data beyond basic CRUD functionality. Key features highlighted include the dashboard interface, easy configuration of list, edit, and form views, internationalization support, and reliance on Symfony components and other Sonata bundles.
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
This talk included tens of tips and tricks, new features and rarely used options for Symfony and its ecosystem. Besides the full-stack Symfony framework, other related technologies were mentioned, like Doctrine, Composer, Twig, PHPUnit and Monolog.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
We, as developers, often think that we don’t have to or don’t need to know what are what they call design patterns. We think that we already know how to build a software and don’t need all this theory. Years after years, by having to deal with the low maintainability of my own codebases, I explored a lot of ways of decoupling applications, in order to have enterprise-grade software that last for years. With concrete examples, I want to share with you some design patterns and how they can help you to grow well structured and decoupled applications.
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
This talk included tens of tips and tricks, new features and rarely used options for Symfony and its ecosystem. Besides the full-stack Symfony framework, other related technologies were mentioned, like Doctrine, Composer, Twig, PHPUnit and Monolog.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
We, as developers, often think that we don’t have to or don’t need to know what are what they call design patterns. We think that we already know how to build a software and don’t need all this theory. Years after years, by having to deal with the low maintainability of my own codebases, I explored a lot of ways of decoupling applications, in order to have enterprise-grade software that last for years. With concrete examples, I want to share with you some design patterns and how they can help you to grow well structured and decoupled applications.
Il arrive parfois que nous, développeurs, pensions qu’il n’est pas nécessaire de connaître ce qu’ils appellent les « design patterns » ou « patrons de conception ». Nous pensons parfois que nous n’avons pas besoin de cette théorie. Après des années d’expériences avec la faible maintenabilité de mon propre code et de celui de mes clients, j’ai exploré de nombreuses façons de découpler nos applications afin de créer des applications « enterprise ready » qui peuvent vivre pendant de nombreuses années. Via des exemples concrets, je vais vous présenter quelques design patterns qui peuvent vous aider à travailler sur une codebase propre, structurée et bien découplée.
First Steps in Drupal Code Driven DevelopmentNuvole
"First Steps in Code Driven Development" covers basic techniques and good practices. Presented during the "Developer Session" at Krimson office, Antwerp (BE), the 27th of May 2010.
What should you test with your unit tests? Some people will say that unit behaviour is best tested through it's outcomes. But what if communication between units itself is more important than the results of it? This session will introduce you to two different ways of unit-testing and show you a way to assert your object behaviours through their communications.
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
A content management system your clients and developers will both be happy with. Open source, built on the Symfony MVC framework. Slides from Symfony Live 2011 in San Francisco
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
Raven developer Jeremy Kendall discusses PHP's Slim micro framework, with code examples from a photography website he built to learn it, also using Twig templating and Composer dependency management.
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
Il arrive parfois que nous, développeurs, pensions qu’il n’est pas nécessaire de connaître ce qu’ils appellent les « design patterns » ou « patrons de conception ». Nous pensons parfois que nous n’avons pas besoin de cette théorie. Après des années d’expériences avec la faible maintenabilité de mon propre code et de celui de mes clients, j’ai exploré de nombreuses façons de découpler nos applications afin de créer des applications « enterprise ready » qui peuvent vivre pendant de nombreuses années. Via des exemples concrets, je vais vous présenter quelques design patterns qui peuvent vous aider à travailler sur une codebase propre, structurée et bien découplée.
First Steps in Drupal Code Driven DevelopmentNuvole
"First Steps in Code Driven Development" covers basic techniques and good practices. Presented during the "Developer Session" at Krimson office, Antwerp (BE), the 27th of May 2010.
What should you test with your unit tests? Some people will say that unit behaviour is best tested through it's outcomes. But what if communication between units itself is more important than the results of it? This session will introduce you to two different ways of unit-testing and show you a way to assert your object behaviours through their communications.
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
A content management system your clients and developers will both be happy with. Open source, built on the Symfony MVC framework. Slides from Symfony Live 2011 in San Francisco
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
Raven developer Jeremy Kendall discusses PHP's Slim micro framework, with code examples from a photography website he built to learn it, also using Twig templating and Composer dependency management.
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
Have you played this Symfony? Why Symfony is great choice for Web developmentMike Taylor
Symfony a top php framework to develop high performance, scalable websites. Here Brainvire a leading symfony development company shows you why one should use symfony for their web development needs. To Get a quick quote on Symfony expertise visit: http://www.brainvire.com/symfony-framework-expertise/
Twig is the template engine used by Drupal 8 and other modern PHP applications. Twig's expressiveness, consistency and secure-by-default policy are still unparalleled among PHP's template engines.
In this session you'll learn advanced techniques, tips and tricks useful for real-world applications and uncommonly used features that will allow you to master Twig.
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterHaehnchen
In 2013 the "Symfony Plugin" for PhpStorm was born. Today we see over 1 million downloads and several other plugins for projects like Laravel, Drupal, Shopware, ... that help to improve your productivity.
I will talk about Symfony related features and will give you some tips and tricks. Also, we take a look at the infrastructure behind these plugins and how I maintain all of them.
Contoh Presentation Latihan Industri (PIS)Syafwan Laili
::Top 5 Industrial Training Presentation::
Polytechnic Ibrahim Sultan, Johor Bahru
Panasonic AVC Networks Pasir Gudang, Malaysia
Diploma in Electronics Engineering Control
This talk represents the combined experience from several web development teams who have been using Symfony2 since months already to create high profile production applications. The aim is to give the audience real world advice on how to best leverage Symfony2, the current rough spots and how to work around them. Aside from covering how to implement functionality in Symfony2, this talk will also cover topics such as how to best integrate 3rd party bundles and where to find them as well as how to deploy the code and integrate into the entire server setup.
Presenting capabilities that develop since WordPress 3.4 of the theme customization screen. In addition to the standard features, there will be also presented more unique functions available, including the use of the changes introduced in the newest WordPress versions. The main aim of the lecture is to convince theme developers that the theme customization screen may completely replace additional subpages of the dashboard with theme options.
Digital Mayflower - Data Pilgrimage with the Drupal Migrate ModuleErich Beyrent
In the year 1620, a collection of data left their proprietary database in search of a new, open ecosystem. Okay, so maybe that's not quite how the story goes, but it works for a modern reboot of the classic saga.
That moment of panic when someone assigns you the task of migrating a legacy site into Drupal. It's a daunting project, fraught with undocumented data, mixed character sets, bizarre content modules, and impossible deadlines. Fortunately, it's now easier than ever to migrate data from an existing source into Drupal, thanks to the Migrate module.
In this session, we'll cover:
An overview of the Migrate module
Common hooks for iterating and transforming your data
Migration from databases, CSV files, and static HTML
How to use Drush to control your migrations
When you move beyond adding simple enhancements to your website with jQuery and start building full-blown client-side applications, how do you organize your code? At this month's Triangle JS Meetup, we'll take a look at patterns for application development using jQuery that promote the principles of tight encapsulation and loose coupling, including classes, the publish/subscribe paradigm, and dependency management and build systems.
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
These are the slides from my presentation at the London Drupal Drop In December 2011. I have posted more information to go along with these slides on my <a>Drupal blog</a>.
Similar to sfDay Cologne - Sonata Admin Bundle (20)
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
2. Who am I ?
• Thomas Rabaix
• Speaker at Symfony Live Conferences
• Author of many symfony1 plugins
• lead developer of the sonata project
• Working at Ekino, a french web agency
3. Talk
• Sonata Project presentation
• Quick Tour
• Under the hood
• Customize / Advanced features
• Conclusion
4. Sonata Project
• A not so young project
• Based on symfony1 plugins
• Recoded with the best practices of
Symfony2
• Built on top on very strong and powerful
framework
5. Sonata Project
• An ecommerce toolbox
• How :
• avoiding reinvented the wheel
• contribution to the community
• built on top of a strong framework
6. Sonata’s bundles
• PageBundle : a page manager with block
as service and strong caching mechanism
• MediaBundle : a media manager on
steroid, you don’t have to worry about
managing files or videos
• UserBundle, IntlBundle, etc ...
• AdminBundle : A backend generator
9. • No admin generator for Symfony 2.0
• Frustrating by the admin generator provided by
symfony1
• Admin is not only about Model; but about
providing a consistent and rich user
experience for managing data.
20. Other Features
• Permissions management
• Flash messages
• Nested Admin
• Command lines utilities
• Translated into more than10 languages
21. Quick Tour Summary
• Dashboard
• Consistent Interface across bundles
• Easy to configure, but powerful for
advanced users
• Advanced features
• Inspired from the django admin module
(user interactions)
22. Under the hood
http://www.flickr.com/photos/52251564@N08/5937620090
23. Admin Class Dependencies
Security Builder
Sonata Admin Bundle
List
Symfony Framework
Translator
Datagrid
Admin Show
Routing
class Form
Validator
Model
Manager
Form
24. Security
• Based on the SecurityHandlerInterface
• 2 built-in implementations
• NoopSecurityHandler : use the
Symfony’s firewall
• AclSecurityHandler : based on ACL
- Advanced users only
25. Security
• Admin Usage
1. protected function configureFormFields(FormMapper $formMapper)
2. {
3. $formMapper
4. ->with('General')
5. ->add('enabled', null, array('required' => false))
6. ->add('author', 'sonata_type_model', array(), array('edit' => 'list'))
7. ->add('title')
8. ->end()
9. ;
10.
11. if (!$this->isGranted('CREATE')) {
12. // do specific code if the user cannot create a new object
13. }
14. }
• Template Usage
1. {% if admin.isGranted('CREATE') %}
2. // DO YOUR STUFF
3. {% endif %}
26. Security : ACL
• Required to have a custom external bundle to
manage permissions and user : see FOS/
UserBundle and Sonata/UserBundle
• Built on top of a custom MaskBuilder (basic
roles : List,View, Edit, Create, Delete)
• Command lines :
• php app/console init:acl
• php app/console sonata:admin:setup-acl
27. Routing
• Definition set from the Admin class
• Can be tweaked by the configureRoute
1. /**
2. * @param SonataAdminBundleRouteRouteCollection $collection
3. * @return void
4. */
5. protected function configureRoutes(RouteCollection $collection)
6. {
7. $collection->add('snapshots'); Add the id parameter
8. $collection->remove('edit');
9.
10. $collection->add('test', $this->getRouterIdParameter().'/test');
11. }
• Template Usage
1. <a href="{{ admin.generateUrl('view', { 'id' : media.id, 'format' : 'reference'}) }}">reference</a>
2. <a href="{{ admin.generateObjectUrl(media, 'view', {'format' : 'reference'}) }}">reference</a>
28. Admin Model Manager
• Persistency layer abstraction for Admin Bundle.
• All Persistencies actions are done in the Model
Manager
• delete, query, pagination, etc..
• form type manipulation delegation
• For now only Doctrine ORM (Propel and
Doctrine ODM are work in progress by external
contributors)
29. Admin Model Manager
• Some bundle provides custom Model Manager
• You can define your own proxy Admin Model
Manager to reuse the Bundle Model Manager
• Use case : Sonata Media Bundle (delete action)
30. Model Manager 1. class AdminModelManager extends ModelManager {
2. protected $manager;
Sonata Media Bundle 3.
4. public function __construct($entityManager, $manager) {
5. parent::__construct($entityManager);
2 Model Managers : 6. $this->manager = $manager;
- entity : deal with deletion and so on ... 7. }
8.
- admin : proxy some methods to the entity 9. public function delete($object) {
10. $this->manager->delete($object);
11. }
How to ? 12. }
1. create a dedicated Admin Model Manager 1. class BundleMediaManager extends AbstractMediaManager {
2. create a Bundle Model Manager 1. public function delete(MediaInterface $media) {
2. $this->pool
3. redefine only required methods 3. ->getProvider($media->getProviderName())
4. define services 4. ->preRemove($media);
5. $this->em->remove($media);
6. $this->em->flush();
Delete thumbnails
7.
8. $this->pool
9. ->getProvider($media->getProviderName())
10. ->postRemove($media);
11. $this->em->flush();
12. }
2. }
1. <service id="sonata.media.admin.media" class="SonataMediaBundleEntityBundleMediaManager">
2. <tag name="sonata.admin" manager_type="orm" group="sonata_media" label="media"/>
3. <argument />
4. <argument>%sonata.media.admin.media.entity%</argument>
5. <argument>%sonata.media.admin.media.controller%</argument>
6.
7. <call method="setModelManager">
8. <argument type="service" id="sonata.media.admin.media.manager" />
9. </call>
10. </service>
11.
12. <service id="sonata.media.admin.media.manager" class="SonataMediaBundleAdminManagerDoctrineModelManager">
13. <argument type="service" id="doctrine.orm.default_entity_manager" />
14. <argument type="service" id="sonata.media.manager.media" />
15. </service>
31. Translator
• 2 catalogues
• SonataAdminBundle used to translate
shared messages
• messages used to translate current Admin
1. $formMapper
2. ->with($this->trans('form_page.group_main_label'))
3. ->add('name')
4. ->end()
5. ;
• Can be set by updating the translationDomain
property
32. Form
• Originally built on the the first implementation
• Too bad ..... major refactoring 3 months later
• Some admin features has been removed or still
broken :(
• But the new form implementation is pretty
awesome .... once you know how to use it.
33. Form Mapper
• Interact with the FormMapper
• Proxy class between the Admin Class and the
Symfony Form Component
• Act as the Symfony FormBuilder component
• You can use your custom field types
34. Core types
Form Type Model Manager Types
Form Types
• AdminType : used to embedded form from
another Admin class
• CollectionType : use by one-to-many association
• ModelType : select choice (like EntityType)
• ModelReferenceType : handle an model id
• ImmutableArrayType : specify a form type per
array element
1. $formMapper->add('settings', 'sonata_type_immutable_array', array(
2. 'keys' => array(
3. array('layout', 'textarea', array()),
4. array('action', 'text', array()),
5. array('parameters', 'text', array()),
6. )
7. ));
35. Validator
• Assert rules can be defined in the validation.
[xml|yml] files (validator component)
nothing new ...
• Conditional Validation
36. Conditional Validation
• Not mandatory, but allow to add inline validation
a runtime.
• ex : check only if a value is set
• Validate method inside the admin class
• Interact with a new ErrorElement object
• The ErrorElement is just a validator service based
on the Validator Component
41. Form : one-to-many
• Type : sonata_type_collection (CollectionType)
• Form Option
by_reference => false
• Sonata Options
• edit : standard / inline
• inline : table | list
• position : field name (if exists)
42. Form : many-to-many
• Type : sonata_type_model (ModelType)
• Sonata Options
• no options
43. Form : many-to-one
• Type : sonata_type_model (ModelType)
• Form Options :
• expanded : true|false
• Sonata Options
• edit : standard (select box) / list (popup)
• link_parameters : add extra link parameters to
the link
44. Form : many-to-one
• Type : sonata_type_admin (AdminType)
• Embed an admin form for an entity into the current
admin
• Sonata Options
• no option!
45. Form Theme
• Based on the form theme mechanism
• Define a getFormTheme()
• a set of form templates
• allows to customize an admin form
46. Form Theme
• Just define a custom block with the correct name ...
• How to know the block name ... ?
• Provide a custom `block_name` option
• or use a defined built-in pattern :
admin_service_id_[type]_[widget|label|errors|row]
admin_service_id_[fieldName]_[widget|label|errors|row]
47. Form block
• Theme definition
1. protected $formTheme = array(
2. 'SonataAdminBundle:Form:form_admin_fields.html.twig',
3. 'SonataNewsBundle:Form:form.html.twig'
4. );
• Block definition
1.{% block sonata_user_admin_user_credentialsExpired_text_widget %}
2. PUT HERE THE WIDGET ...
3.{% endblock %}
• Et voila!
49. CRUD Controller
• Use the admin class to generate required
objects
• contains create, edit, update, delete and
batch actions
• can be extended to change some logic
• use case : Sonata Media Bundle
50. Custom CRUD Controller
1. namespace SonataMediaBundleController;
2.
3. use SonataAdminBundleControllerCRUDController as Controller; Grant check
4. use SymfonyComponentSecurityCoreExceptionAccessDeniedException;
5.
6. class MediaAdminController extends Controller {
7. public function createAction() {
8. if (false === $this->admin->isGranted('CREATE')) {
9. throw new AccessDeniedException();
10. }
11.
12. $parameters = $this->admin->getPersistentParameters();
13.
14. if (!$parameters['provider']) {
Custom Template
15. return $this-
>render('SonataMediaBundle:MediaAdmin:select_provider.html.twig', array(
16. 'providers' => $this->get('sonata.media.pool')
17. ->getProvidersByContext($this->get('request')-
>get('context', 'default')),
18. 'base_template' => $this->getBaseTemplate(),
19. 'admin' => $this->admin,
20. 'action' => 'create'
21. ));
22. }
23.
24. return parent::createAction();
25. }
26.}
Parent action
51. Nested Admin
• clean url : /admin/sonata/news/post/1/comment/list
• reuse other admin definition
• autofilter with the targeted elements
• only work on one level
• You don’t need to know routing name, as long as
you use the admin class
54. Admin Extension
• Allow to add extra feature or redefine some field to
the admin
• Good entry point if you extends some entities
• Add extension must implement the
AdminExtensionInterface and define as
service with the sonata.admin.extension
55. Debug
• Check out external configurations
• validator configuration
• doctrine schema definition
• use firebug to check Ajax errors (missing toString method or
type hinting)
• Get information from the Admin command tools
• sonata:admin:list
• sonata:admin:explain
59. small numbers
• First commit in
november 2010
• 650 commits
• 49 Contributors!
• 14 Translations
Thanks!
60. What’s next ?
• Version 1
• Stabilize the AdminBundle
• Add more tests... : 56 tests, 145
assertions
• Version 1.1
• Add missing features from the original
form factoring
• Add more layer persistency
(contribution)