Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
Like many others, WordPress has been my personal blogging tool for a long time. A powerful tool for easy publishing! That is what everyone wants.
Large sites like TechCrunch and TheNextWeb use it exactly for that reason. And more enterprises seem to discover it as good solution to their too-expensive publication tools. But keeping those WordPress instances running requires skills and knowledge.
Because of WordPress extendibility and its very active community, you can do this too. This tutorial will teach you how use Ansible, Composer, WP-CLI, WP REST API, and Elasticsearch can push WordPress from a personal blogging tool into an enterprise-worthy level application. Out with FTP based SCM ... in with automated deployment, dependency management, and utterly fast search.
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
There are a number of ways to add custom meta boxes to WordPress admin, from coding against core functions through code API frameworks to GUI interfaces. All of these have a place, but which is the right one for your project, code style and coding level? In this talk I will provide code examples and illustrations of the code techniques for each of the methods.
Time permitting, I will also show you how to extend the frameworks.
Aimed at all levels of developer because of the range of options covered.
Slides of my talk I gave @ PyRE.it in ReggioEmilia about developing a Rest Api in Python using a little bit of Flask and SqlAlchemy.
www.pyre.it
www.alessandrocucci.it/pyre/restapi
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Using Geeklog as a Web Application FrameworkDirk Haun
Slides for the workshop "Using Geeklog as a Web Application Framework", as held at
- LinuxTag 2006, Wiesbaden, Germany, 2006-05-06
- PHP user group meeting, Stuttgart, Germany, 2006-05-10
- FrOSCon, Bonn, Germany, 2006-06-24
É importante que você comece o quanto antes a sua preparação. Não há tempo a perder! Se você quer mesmo ser aprovado no concurso do INSS, é preciso colocar todas as suas armas em jogo.
O Estratégia Concursos quer muito lhe ajudar nessa jornada. Por isso, esse artigo irá lhes apresentar 3 (três) fundamentos essenciais para a aprovação no concurso do INSS. Nós iremos sugerir, inclusive, um Plano de Estudos para aqueles alunos que estão “começando do zero”.
Leia mais no blog: http://www.estrategiaconcursos.com.br/blog/concurso-inss-saiba-como-fazer-o-seu-plano-de-estudos/
Plano de Estudo para o TRE-SP (Técnico Judiciário)Ricardo Torques
Para continuar acompanhando nossos materiais gratuitos, sugiro que você se inscreva em nossa lista EXCLUSIVA de e-mail. Com frequência, vamos encaminhar conteúdos gratuitos de qualidade para quem estiver estudando Direito Eleitoral.
Inscreva-se aqui:
http://bit.ly/dtoeleitoral
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
Like many others, WordPress has been my personal blogging tool for a long time. A powerful tool for easy publishing! That is what everyone wants.
Large sites like TechCrunch and TheNextWeb use it exactly for that reason. And more enterprises seem to discover it as good solution to their too-expensive publication tools. But keeping those WordPress instances running requires skills and knowledge.
Because of WordPress extendibility and its very active community, you can do this too. This tutorial will teach you how use Ansible, Composer, WP-CLI, WP REST API, and Elasticsearch can push WordPress from a personal blogging tool into an enterprise-worthy level application. Out with FTP based SCM ... in with automated deployment, dependency management, and utterly fast search.
The REST API is an awesome plugin to expose your data from the WordPress core. But … the standard implementation might not fit your specific case.
Just like the WordPress core, you'll be able to extend it to your specific needs. I'll show you how to handle authentication, introduce caching strategies, alter custom post types, or even change the default way of communication altogether.
There are a number of ways to add custom meta boxes to WordPress admin, from coding against core functions through code API frameworks to GUI interfaces. All of these have a place, but which is the right one for your project, code style and coding level? In this talk I will provide code examples and illustrations of the code techniques for each of the methods.
Time permitting, I will also show you how to extend the frameworks.
Aimed at all levels of developer because of the range of options covered.
Slides of my talk I gave @ PyRE.it in ReggioEmilia about developing a Rest Api in Python using a little bit of Flask and SqlAlchemy.
www.pyre.it
www.alessandrocucci.it/pyre/restapi
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Using Geeklog as a Web Application FrameworkDirk Haun
Slides for the workshop "Using Geeklog as a Web Application Framework", as held at
- LinuxTag 2006, Wiesbaden, Germany, 2006-05-06
- PHP user group meeting, Stuttgart, Germany, 2006-05-10
- FrOSCon, Bonn, Germany, 2006-06-24
É importante que você comece o quanto antes a sua preparação. Não há tempo a perder! Se você quer mesmo ser aprovado no concurso do INSS, é preciso colocar todas as suas armas em jogo.
O Estratégia Concursos quer muito lhe ajudar nessa jornada. Por isso, esse artigo irá lhes apresentar 3 (três) fundamentos essenciais para a aprovação no concurso do INSS. Nós iremos sugerir, inclusive, um Plano de Estudos para aqueles alunos que estão “começando do zero”.
Leia mais no blog: http://www.estrategiaconcursos.com.br/blog/concurso-inss-saiba-como-fazer-o-seu-plano-de-estudos/
Plano de Estudo para o TRE-SP (Técnico Judiciário)Ricardo Torques
Para continuar acompanhando nossos materiais gratuitos, sugiro que você se inscreva em nossa lista EXCLUSIVA de e-mail. Com frequência, vamos encaminhar conteúdos gratuitos de qualidade para quem estiver estudando Direito Eleitoral.
Inscreva-se aqui:
http://bit.ly/dtoeleitoral
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
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/
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
To automate entire operations and information of vehicles at a particular given point of time. So that the Cab operator and their customer can get best and fast information about their vehicles and drivers at any point of time. He needs to exercise tight control on the operations and input costs if he is to provide good service at reasonable rates and yet remain profitable.
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and moreRyan Weaver
There are so many interesting ways to authenticate a user: via an API token, social login, a traditional HTML form or anything else you can dream up.
But until now, creating a custom authentication system in Symfony has meant a lot of files and a lot of complexity.
Introducing Guard: a simple, but expandable authentication system built on top of Symfony's security component. Want to authenticate via an API token? Great - that's just one class. Social login? Easy! Have some crazy legacy central authentication system? In this talk, we'll show you how you'd implement any of these in your application today.
Don't get me wrong - you'll still need to do some work. But finally, the path will be clear and joyful.
Symfony: Your Next Microframework (SymfonyCon 2015)Ryan Weaver
Microservices are a huge trend, and microframeworks are perfect for them: put together just a few files, write some code, and your done!
But Symfony is a big framework, right? Wrong! Symfony can be as small as a single file!
In this talk, we'll learn how to use Symfony as a micro-framework for your next project. Your app will stay small and clear, but without needing to give up the features or third-party bundles that you love. And if the project grows, it can evolve naturally into a full Symfony project.
So yes, Symfony can also be a microframework. Tell the world!
Plano completo de estudos, estruturado em ciclos semanais, com períodos de revisão, reposição e revisão na semana que antecede do Exame. A cada dia haverá um grupo de disciplinas a serem estudas proporcionalmente conforme o número de questões cobradas em Exames anteriores.
Plano de Estudo para o TRE-SP (Analista Judiciário - Área Administrativa)Ricardo Torques
Para continuar acompanhando nossos materiais gratuitos, sugiro que você se inscreva em nossa lista EXCLUSIVA de e-mail. Com frequência, vamos encaminhar conteúdos gratuitos de qualidade para quem estiver estudando Direito Eleitoral.
Inscreva-se aqui:
http://bit.ly/dtoeleitoral
Plano de Estudo para o TRE-SP (Analista Judiciário - Área Judiciária)Ricardo Torques
Para continuar acompanhando nossos materiais gratuitos, sugiro que você se inscreva em nossa lista EXCLUSIVA de e-mail. Com frequência, vamos encaminhar conteúdos gratuitos de qualidade para quem estiver estudando Direito Eleitoral.
Inscreva-se aqui:
http://bit.ly/dtoeleitoral
Comentários à prova de Pessoas com Deficiência - TRT 11ª RegiãoRicardo Torques
Confira análise das questões aplicadas no último concurso do Tribunal Regional do Trabalho da 11ª Região, em relação à disciplina Noções sobre Pessoas com Deficiência.
Editais da banca FCC com o conteúdo de Matemática e Raciocínio Lógico cobrados em 18 concursos recentes de Analista ou Técnico de Tribunais (TRTs, TRFs, TREs e TJs)
Leia mais no blog: http://www.estrategiaconcursos.com.br/blog/editais-da-fcc-de-matematica-e-rac-logico-para-tribunais/
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
Build powerfull and smart web applications with Symfony2Hugo Hamon
Symfony2 first stable release is scheduled for the first week of March 2011. During this session, we will have a look at the new framework architecture and most of its powerfull features.
We will show you how Symfony2 implements the MVC pattern and an HTTP request is processed and converted as a response for the end user. Of course, we will talk about the configuration principles and how it's easy to configure Symfony2 project parts like the routing system or the data model. We will also focus on other major components of the framework like the Doctrine2 integration, forms, security (authentication and authorizations) or HTTP cache management.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
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.
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.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
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.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
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.
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
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
2. My background
John Cleveley
Trained as a Systems Engineer with BAE Systems
Started my own business in 2006
Created symfony apps for NHS, V&A Museum and
Hornby.
Currently work at the BBC using their Forge
platform (ZF)
3.
4. Objectives
Provide information beyond the docs
Update on what’s new
Suggest a few best practices
Real world examples of customising
How to get the best from the form framework
Utilise the various ways of extending
5. It’s super awesome.
Saves huge amount of development time and costs
Provides most common admin requirements out of
the box
Can be extended to provide bespoke needs
Fully tested and documented
It’s free!
6. What’s new since 1.0?
Completely re-written for the form framework
Relationships including m2m work without
configuration
Generator.yml is validated
Batch actions (delete)
Less reliance on generator.yml (DRY)
More templates and actions to override
Different configuration for the edit and new form
Adds a REST route for your module
7. New PHP configuration file
Configure generator via PHP to be more dynamic:
lib/newsGeneratorConfiguration.class.php
The generated class in the cache lists functions
cache/backend/dev/modules/autoNews/lib/BaseNe
wsGeneratorConfiguration.class.php
You can also mix configuration between the two
8. New helper file
Provides html snippets for action links
lib/[module]GeneratorHelper.class.php
getUrlForAction ()
linkToDelete ()
linkToEdit ()
linkToList ()
linkToNew ()
linkToSave ()
linkToSaveAndAdd ()
Create custom links with extra javascript etc
11. Think requirements!
Don’t jump to use the admin generator
Analyse what’s needed first
A bespoke solution may be more appropriate
Misusing the admin generator could cause big
problems in the future
12. How do we decide?
Admin Bespoke
Normal CRUD operations Public interface to data
Non – technical users Sophisticated sorting
need to add data and searching of data
Trusted site administrators
Ownership of all records
The admin site can take you a long way….
…. But be careful it doesn’t become a mess.
14. 10 Commandments (1-5)
1. Understand the client’s workflow and customise
admin to suit
2. Think about security from the start
3. Look through and understand the cached php
files
4. Change table_method to reduce db calls
5. Use bespoke Form class for admin if different
15. 10 Commandments (6-10)
6. Keep all form form configuration in the Form Class
7. If you need to make changes to multiple admin
modules – create a theme.
8. Think about small screens and target browser
9. Create functional tests – guard against regression
10. Maintain good MVC and decoupling practices
18. 1. The URL
Clients don’t like using:
application.com/admin.php
Option 1:
application.com/admin
Option 2:
admin.application.com
19. 1. The URL: /admin
Modify web/.htaccess
RewriteCond %{REQUEST_URI} ^/admin/?
RewriteRule ^(.*)$ admin.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
Change all your standard routes – routing.yml
homepage:
url: /admin
param: { module: default, action: index }
test:
url: /admin/test
...
20. 1. The URL: /admin
Change your route collections – routing.yml
prefix_path: /admin/module_name
Remove script name in urls – settings.yml
prod:
.settings:
no_script_name: true
21. 1. The URL: admin.app
Create a new virtual host in httpd.conf
<VirtualHost *:80>
ServerName admin.application.com
DirectoryIndex admin.php
DocumentRoot "/path/to/web/folder"
<Directory "/path/to/web/folder">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Tell symfony not to output admin.php in urls
Prod
.settings:
no_script_name: true
22. 2. Dynamic MaxPerPage
Add a select box within the _list_header.php
js onchange
submits to action
Add an action to set a user attribute
public function executeChangeMaxPage(sfWebRequest $request){
$this->getUser()->setAttribute('maxPage',
$request->getParameter('maxPage'));
$this->redirect($request->getReferer());
}
23. 2. Dynamic MaxPerPage
Override getPagerMaxPerPage()
class employeeGeneratorConfiguration extends BaseEmployee
{
public function getPagerMaxPerPage()
{
$maxPage = sfContext::getInstance()->getUser()
->getAttribute('maxPage', 10);
return $maxPage;
}
}
24. 3. Adding relations
Fewest clicks for common tasks
Relevant data placed together
Currently unsupported by the generator
Symfony provides functions to help
sfForm : : mergeForm()
sfForm : : embedForm()
sfFormDoctrine : : embedRelation()
26. 3. Adding relations
Add ability to edit existing phone numbers from
within employee form
Embed the ‘Phones’ relation in EmployeeForm::configure
class EmployeeForm extends BaseEmployeeForm
{
public function configure()
{
$this->embedRelation('Phones');
}
}
27. Hide employee_id in PhoneForm::configure()
class PhoneForm extends BasePhoneForm
{
public function configure()
{
$this->widgetSchema['employee_id'] =
new sfWidgetFormInputHidden();
...
No Delete?
No Add?
28. There’s a symfony plugin for that!
Thanks to ahDoctrineEasyEmbeddedRelationsPlugin by
Daniel Lohse
29. 4. Translate admin interface
Add chosen culture to settings.yml
.all:
.settings:
i18n: on
default_culture: fr
./symfony cc and delete browser cookies
30. 4. Translate admin interface
Create a new startrek catalogue
Add vulcan XLIFF files to:
apps/admin/il8n/
• startrek.vu.xml
• startrek_forms.vu.xml
32. 4. Translate admin interface
Tell admin generator to use alternative catalogue
generator:
class: sfDoctrineGenerator
param:
i18n_catalogue: startrek
Tell the forms as well – sfFormDoctrine::setup()
abstract class BaseFormDoctrine extends sfFormDoctrine
{
public function setup()
{
$this->widgetSchema->getFormFormatter()
->setTranslationCatalogue('startrek_forms');
}
}
33. 5. Tidy up filters
Filters work great – but the default style is a bit off
A few CSS tweaks
35. What is the definition of
programmer?
Programmers are machines that turn
coffee into code.
36. 6. Timestampable fields
Generally don’t need to edit these
Simply unset them in form class
class NewsForm extends BaseNewsForm
{
public function configure()
{
unset($this['created_at'], $this['updated_at']);
}
}
38. 6. Timestampable fields
Use sfWidgetFormPlain widget
http://trac.symfony-project.org/attachment/ticket/7963/sfWidgetPlain.diff
public function configure()
{
$this->setWidget('created_at',
new sfWidgetFormPlain(array('value'=>$this->getObject()->created_at)));
unset($this->validatorSchema['created_at']);
$this->setWidget('updated_at',
new sfWidgetFormPlain(array('value'=>$this->getObject()->updated_at)));
unset($this->validatorSchema['updated_at']);
...
Thanks to Stephen.Ostrow
40. 7. Pre-filter list
Add an object action to generator.yml
list:
object_actions:
_edit: ~
viewPhones: { label: Phone numbers, action: viewPhones }
Set filter atribute in user session
class employeeActions extends autoEmployeeActions
{
public function executeViewPhones($request){
$this->getUser()->setAttribute(
'phone.filters',
array('employee_id' => $request->getParameter('id')),
'admin_module'
);
$this->redirect($this->generateUrl('phone'));
}
}
41. 8. Row level ownership
Only allow owners of objects access
Example presumes:
sfGuard plugin is installed
Objects have a user_id field fk
42. 8. Row level ownership
Secure the list page - moduleActions::buildquery()
protected function buildQuery(){
$query = parent::buildQuery();
$query->andWhere(
'user_id = ?', $this->getUser()->getId()
);
return $query;
} This belongs in the model!!
43. 8. Row level ownership
Secure all other actions - moduleActions::preExecute()
public function preExecute(){
if($this->getActionName()!= 'new' &&
$this->getActionName()!= 'index'){
$this->forward404Unless(
$this->getUser()->isOwner($this->getRoute()->getObject())
);
}
parent::preExecute();
}
44. 8. Row level ownership
Add a new method to user class - myUser::isOwner()
class myUser extends sfGuardSecurityUser
{
public function isOwner($obj){
if(is_object($obj)){
if($this->getId() == $obj->getUserId()) return true;
}
return false;
}
}
45. 8. Row level ownership
What about the user_id field in the form?
Don’t want users to change owner
Also be careful with injected data
46. 8. Row level ownership
We need to remove the widget - Form::configure()
public function configure()
{
unset($this['user_id']);
...
Set the user_id manually – Form::doUpdateObject()
public function doUpdateObject($values){
$userId = sfContext::getInstance()->getUser()->getId();
$this->getObject()->setUserId($userId);
return parent::doUpdateObject($values);
}
eatmymonkeydust.com
47. 9. Custom filters
Find out who has a birthday today
Add the new filter name to generator.yml
filter:
display: [ name, birthday_today ]
fields:
birthday_today:
help: Employees who have a birthday today!
Based on info from Tomasz Ducin and dlepage
48. 9. Custom filters
Create a new widget in - xxFormFilter::configure()
public function configure()
{
$this->widgetSchema['birthday_today'] =
new sfWidgetFormInputCheckbox();
$this->validatorSchema['birthday_today'] =
new sfValidatorPass();
}
Filter form is now displayed
49. 9. Custom filters
Add a add*ColumnQuery to FormFilter class
public function addBirthdayTodayColumnQuery($query,$field,$value)
{
if($value){
$query->andWhere("SUBSTRING(`birthday`, 6, 5)
= SUBSTRING(NOW(), 6, 5)");
}
return $query;
}
Now buy the presents!
51. sfAdminDashPlugin
Kevin Bond
Joomla style admin
Adds a dashboard
Configurable admin
navigation
Replaces the admin css
Manually add header
component and footer
partial to layout
52. sfAdminThemejRollerPlugin
Gerald Estadieu
Looks stunning
jQuery
Theme roller system
Popup filters
Tabs in edit view
Completely new admin
theme
53. Optimist : The glass is half full.
Pessimist : The glass is half empty..
Coder: The glass is twice as big as it needs
to be
56. Extending - Override code
Override individual templates and actions
Quick and easy
Can’t be re-used between modules
Can become untidy
57. Extending – Create a theme
More work upfront
Can be used for multiple modules / projects
Much more scope for customising
Steep learning curve – PHP in PHP!
58. Extending – Create a theme
Create container folder for new theme
mkdir -p data/generator/sfDoctrineModule/newtheme
Copy the generator files from sfDoctrine plugin
cp -r lib/vendor/symfony/lib/plugins/
→ sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/*
→ data/generator/sfDoctrineModule/newtheme/
59. Extending – Create a theme
Name of theme
Parts – Snippets of code
included into cache
Skeleton – copied to admin
module
Templates – generated into
cache
60. Extending – Create a theme
Change theme name in generator.yml
generator:
class: sfDoctrineGenerator
param:
model_class: News
theme: newtheme
...
Clear cache
You’ve made your own theme!
61. Extending – Admin events
admin.pre_execute: Notified before any action is
executed.
admin.build_criteria: Filters the Criteria used for the
list view.
admin.save_object: Notified just after an object is
saved.
admin.delete_object: Notified just before an object
will be deleted.
65. Future….
What do you want the admin generator to do?
What should the scope of the generator be?
Better support for embedded forms?
More customisable list view (sfGrid)?
Fulltext search in the fields?
Saving goes back to list view?
Dashboard?
Nested sets? Ordering?
Inherit from multiple themes?