Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Nashville Php Symfony Presentation

on

  • 4,745 views

Travis Black and I gave a brief Symfony overview at a PHP meetup in Nashville. The group featured different PHP frameworks each week, including Cake, Code Igniter, and Zend.

Travis Black and I gave a brief Symfony overview at a PHP meetup in Nashville. The group featured different PHP frameworks each week, including Cake, Code Igniter, and Zend.

Statistics

Views

Total Views
4,745
Views on SlideShare
4,739
Embed Views
6

Actions

Likes
1
Downloads
16
Comments
0

2 Embeds 6

http://www.slideshare.net 5
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Nashville Php Symfony Presentation Nashville Php Symfony Presentation Presentation Transcript

  • 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
    Getting Started $this-> enableAllPluginsExcept ( array ( 'sfPropelPlugin' , 'sfCompat10Plugin' )); all: doctrine: class : sfDoctrineDatabase param: classname: DoctrinePDO dsn: mysql :dbname=topos;host=localhost
    • 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: &quot;2009-30-31&quot; 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