SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Symfony 1.2
Brent Shaffer
Travis Black
Getting Started
Download and install symfony
•Sandbox
• http://www.symfony-project.org/tutorial/1_0/my-first-project
•$ ./symfony generate:project projectname
•$ ./symfony generate:app frontend
• $ ./symfony freeze ~/Sites/symfony/1.2/data/
•edit config/ProjectConfiguration.class.php
•edit config/databases.yml
$this->enableAllPluginsExcept(array('sfPropelPlugin', 'sfCompat10Plugin'));
all:
doctrine:
class: sfDoctrineDatabase
param:
classname: DoctrinePDO
dsn: mysql:dbname=topos;host=localhost
Getting Started
• edit your schema.yml
• Build your database, models, and forms
• $ ./symfony doctrine:build-all-reload
• Take a second to examine generated classes
Create your Blog Model
BlogPost:
columns:
title:
type: string(255)
description:
type: clob
notnull: true
pubdate:
type: timestamp
author:
type: string(255)
Create your Blog Module
• $ ./symfony generate:module blog_post
• By default, pages are viewable at /:module/:action
• browse to http://localhost/myproject/blog_post
• Default action is index
Add your Data Fixtures
• create a data/fixtures/BlogPost.yml
BlogPost:
my_blog_post:
title: First Post
description: |
<p>
ante. egestas. augue, Vestibulum lacus Nam senectus sed,
sagittis sit Mauris erat commodo tincidunt dui vitae,
egestas Aenean Donec malesuada tincidunt eleifend tortor
fames metus accumsan quam condimentum rutrum eros pulvinar
Pellentesque et egestas Donec neque Ut amet leo. pharetra.
sit ullamcorper est placerat et non quam, eu dapibus,
tempus orci, fermentum, in amet, facilisis. semper. dui.
netus ac tempor erat enim vitae faucibus, mi, vulputate
elit amet sit ornare eget erat. eros turpis ipsum wisi,
ultricies Praesent mi cursus habitant felis. tortor
</p>
timestamp: "2009-30-31"
author: Brent Shaffer
• Now we can manipulate our data
Edit your Actions
• Pull in your Blog objects
public function executeIndex(sfWebRequest $request)
{
$q = Doctrine_Query::create()
->from('BlogPost b');
$this->posts = $q->execute();
}
• Edit your View (templates/indexSuccess.php)
Examine your Layout
• Layout is rendered after modules
• $sf_content, $sf_request, $sf_user,
$sf_response, $sf_request available
Admin Generator
• $ ./symfony doctrine:generate-admin backend
BlogPost
• Examine generator.yml, Form Classes
• Out-of-the-box Authentication
• Form Framework
Doctrine Behaviors
• Install csActAsCommentablePlugin
• $ svn co path/to/plugin/csActAsCommentablePlugin
plugins/csDoctrineActAsCommentablePlugin
• Add behavior to schema.yml
BlogPost:
actAs:
Commentable:
Doctrine Behaviors
• Rebuild your models, clear your cache
• Add the component to your view
<div class='comments'>
<?php include_component('csComments', 'thread', array('record' => $post)) ?>
</div>
Closing Points
• cascading configuration
• routing.yml
• app.yml
• view.yml
• filters
• test framework
• nested forms
• auto caching
• i18n support

Weitere ähnliche Inhalte

Was ist angesagt?

One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009Philippe Gamache
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptfpatton
 
Netty - anfix tech&beers
Netty - anfix tech&beersNetty - anfix tech&beers
Netty - anfix tech&beersjorgecarabias
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applicationsfpatton
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
Scripting as a Second Language
Scripting as a Second LanguageScripting as a Second Language
Scripting as a Second LanguageRob Dunn
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Timothy Appnel
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on WindowsWO Community
 
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...NETWAYS
 
PTW Rails Bootcamp
PTW Rails BootcampPTW Rails Bootcamp
PTW Rails BootcampMat Schaffer
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションbluepapa32
 
Trick or Tip - Symfony Edition
Trick or Tip - Symfony EditionTrick or Tip - Symfony Edition
Trick or Tip - Symfony EditionDionyshs Tsoumas
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingColdFusionConference
 
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++Uilian Ries
 
Rapid dev env DevOps Warsaw July 2014
Rapid dev env DevOps Warsaw July 2014Rapid dev env DevOps Warsaw July 2014
Rapid dev env DevOps Warsaw July 2014blndrt
 
Development of Ansible modules
Development of Ansible modulesDevelopment of Ansible modules
Development of Ansible modulesjtyr
 

Was ist angesagt? (19)

One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
Netty - anfix tech&beers
Netty - anfix tech&beersNetty - anfix tech&beers
Netty - anfix tech&beers
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applications
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
Scripting as a Second Language
Scripting as a Second LanguageScripting as a Second Language
Scripting as a Second Language
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
 
Cucumber Jruby for BEginners
Cucumber Jruby for BEginnersCucumber Jruby for BEginners
Cucumber Jruby for BEginners
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...
OSDC 2013 | Ansible: configuration management doesn't have to be complicated ...
 
PTW Rails Bootcamp
PTW Rails BootcampPTW Rails Bootcamp
PTW Rails Bootcamp
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーション
 
Trick or Tip - Symfony Edition
Trick or Tip - Symfony EditionTrick or Tip - Symfony Edition
Trick or Tip - Symfony Edition
 
Hack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security TrainingHack & Fix, Hands on ColdFusion Security Training
Hack & Fix, Hands on ColdFusion Security Training
 
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
 
Rapid dev env DevOps Warsaw July 2014
Rapid dev env DevOps Warsaw July 2014Rapid dev env DevOps Warsaw July 2014
Rapid dev env DevOps Warsaw July 2014
 
Development of Ansible modules
Development of Ansible modulesDevelopment of Ansible modules
Development of Ansible modules
 
IOS 11 setup with appium latest
IOS 11 setup with appium  latestIOS 11 setup with appium  latest
IOS 11 setup with appium latest
 

Ähnlich wie Nashville Php Symfony Presentation

Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unitChristian Schaefer
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvarsSam Marley-Jarrett
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Fabien Potencier
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoveragemlilley
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with DrupalPromet Source
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.jsChris Cowan
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.jsPrabin Silwal
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARISSymfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARISeZ Systems
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Antonio Peric-Mazar
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrbAntonio Peric-Mazar
 

Ähnlich wie Nashville Php Symfony Presentation (20)

Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unit
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
はじめてのSymfony2
はじめてのSymfony2はじめてのSymfony2
はじめてのSymfony2
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Composer
ComposerComposer
Composer
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
Running Symfony
Running SymfonyRunning Symfony
Running Symfony
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.js
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARISSymfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
 

Mehr von Brent Shaffer

HTTP - The Protocol of Our Lives
HTTP - The Protocol of Our LivesHTTP - The Protocol of Our Lives
HTTP - The Protocol of Our LivesBrent Shaffer
 
OAuth2 - The Swiss Army Framework
OAuth2 - The Swiss Army FrameworkOAuth2 - The Swiss Army Framework
OAuth2 - The Swiss Army FrameworkBrent Shaffer
 
Why Open Source is better than Your Homerolled Garbage
Why Open Source is better than Your Homerolled GarbageWhy Open Source is better than Your Homerolled Garbage
Why Open Source is better than Your Homerolled GarbageBrent Shaffer
 
OAuth 2.0 (as a comic strip)
OAuth 2.0 (as a comic strip)OAuth 2.0 (as a comic strip)
OAuth 2.0 (as a comic strip)Brent Shaffer
 
In The Future We All Use Symfony2
In The Future We All Use Symfony2In The Future We All Use Symfony2
In The Future We All Use Symfony2Brent Shaffer
 
Nashville Symfony Functional Testing
Nashville Symfony Functional TestingNashville Symfony Functional Testing
Nashville Symfony Functional TestingBrent Shaffer
 
Nashvile Symfony Routes Presentation
Nashvile Symfony Routes PresentationNashvile Symfony Routes Presentation
Nashvile Symfony Routes PresentationBrent Shaffer
 

Mehr von Brent Shaffer (9)

Web Security 101
Web Security 101Web Security 101
Web Security 101
 
HTTP - The Protocol of Our Lives
HTTP - The Protocol of Our LivesHTTP - The Protocol of Our Lives
HTTP - The Protocol of Our Lives
 
OAuth2 - The Swiss Army Framework
OAuth2 - The Swiss Army FrameworkOAuth2 - The Swiss Army Framework
OAuth2 - The Swiss Army Framework
 
Why Open Source is better than Your Homerolled Garbage
Why Open Source is better than Your Homerolled GarbageWhy Open Source is better than Your Homerolled Garbage
Why Open Source is better than Your Homerolled Garbage
 
OAuth 2.0 (as a comic strip)
OAuth 2.0 (as a comic strip)OAuth 2.0 (as a comic strip)
OAuth 2.0 (as a comic strip)
 
In The Future We All Use Symfony2
In The Future We All Use Symfony2In The Future We All Use Symfony2
In The Future We All Use Symfony2
 
Symfony Events
Symfony EventsSymfony Events
Symfony Events
 
Nashville Symfony Functional Testing
Nashville Symfony Functional TestingNashville Symfony Functional Testing
Nashville Symfony Functional Testing
 
Nashvile Symfony Routes Presentation
Nashvile Symfony Routes PresentationNashvile Symfony Routes Presentation
Nashvile Symfony Routes Presentation
 

Kürzlich hochgeladen

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Kürzlich hochgeladen (20)

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Nashville Php Symfony Presentation

  • 2. Getting Started Download and install symfony •Sandbox • http://www.symfony-project.org/tutorial/1_0/my-first-project •$ ./symfony generate:project projectname •$ ./symfony generate:app frontend
  • 3. • $ ./symfony freeze ~/Sites/symfony/1.2/data/ •edit config/ProjectConfiguration.class.php •edit config/databases.yml $this->enableAllPluginsExcept(array('sfPropelPlugin', 'sfCompat10Plugin')); all: doctrine: class: sfDoctrineDatabase param: classname: DoctrinePDO dsn: mysql:dbname=topos;host=localhost Getting Started
  • 4. • edit your schema.yml • Build your database, models, and forms • $ ./symfony doctrine:build-all-reload • Take a second to examine generated classes Create your Blog Model BlogPost: columns: title: type: string(255) description: type: clob notnull: true pubdate: type: timestamp author: type: string(255)
  • 5. Create your Blog Module • $ ./symfony generate:module blog_post • By default, pages are viewable at /:module/:action • browse to http://localhost/myproject/blog_post • Default action is index
  • 6. Add your Data Fixtures • create a data/fixtures/BlogPost.yml BlogPost: my_blog_post: title: First Post description: | <p> ante. egestas. augue, Vestibulum lacus Nam senectus sed, sagittis sit Mauris erat commodo tincidunt dui vitae, egestas Aenean Donec malesuada tincidunt eleifend tortor fames metus accumsan quam condimentum rutrum eros pulvinar Pellentesque et egestas Donec neque Ut amet leo. pharetra. sit ullamcorper est placerat et non quam, eu dapibus, tempus orci, fermentum, in amet, facilisis. semper. dui. netus ac tempor erat enim vitae faucibus, mi, vulputate elit amet sit ornare eget erat. eros turpis ipsum wisi, ultricies Praesent mi cursus habitant felis. tortor </p> timestamp: "2009-30-31" author: Brent Shaffer • Now we can manipulate our data
  • 7. Edit your Actions • Pull in your Blog objects public function executeIndex(sfWebRequest $request) { $q = Doctrine_Query::create() ->from('BlogPost b'); $this->posts = $q->execute(); } • Edit your View (templates/indexSuccess.php)
  • 8. Examine your Layout • Layout is rendered after modules • $sf_content, $sf_request, $sf_user, $sf_response, $sf_request available
  • 9. Admin Generator • $ ./symfony doctrine:generate-admin backend BlogPost • Examine generator.yml, Form Classes • Out-of-the-box Authentication • Form Framework
  • 10. Doctrine Behaviors • Install csActAsCommentablePlugin • $ svn co path/to/plugin/csActAsCommentablePlugin plugins/csDoctrineActAsCommentablePlugin • Add behavior to schema.yml BlogPost: actAs: Commentable:
  • 11. Doctrine Behaviors • Rebuild your models, clear your cache • Add the component to your view <div class='comments'> <?php include_component('csComments', 'thread', array('record' => $post)) ?> </div>
  • 12. Closing Points • cascading configuration • routing.yml • app.yml • view.yml • filters • test framework • nested forms • auto caching • i18n support