Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony 1.4 Workshop

Symfony 1.4 Workshop

Muhammadali Shaduli

September 03, 2012
Tweet

More Decks by Muhammadali Shaduli

Other Decks in Programming

Transcript

  1. Training Agenda (10 hrs)  INTRODUCTION  FRAMEWORK INSTALLATION 

    TEMPLATING WITH SYMFONY  SYMFONY DEVELOPMENT ENVIRONMENT  THE ROUTING SYSTEM  OBJECT RELATIONAL MAPPING ABSTRACTION  ADMIN GENERATOR  AUTHENTICATION AND ACL  SYMFONY FORMS  INTERNATIONALIZATION AND LOCALIZATION  AUTOMATED TESTS  DEPOLOYING SYMFONY APPS
  2. Prerequisites  KNOWLEDGE OF PHP 5  OBJECT ORIENTED METHADOLOGY

     LAYERED ARCHITECTURE  DESIGN PATTERNS AND MVC  DATABASE ABTSTRACTION(PDO)  KNOWLEDGE OF COMMAND LINE INTERFACE  KNOWLEDGE OF LINUX IS RECOMMENDED
  3. INTRODUCTION  Symfony is a full-stack framework, a library of

    cohesive classes written in PHP.  It provides an architecture, components and tools for developers to build complex web applications faster.  Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise.  Symfony is based on experience. It does not reinvent the wheel: it uses most of the best practices of web development and integrates some great third-party libraries.  Thousands of developers already trust symfony for their applications!
  4. MVC IN SYMFONY The MVC pattern is designed to split

    the presentation and business logic, and has a controller that manages the user's interactions between the two
  5. CONTROLLER The controller is responsible for processing user events. The

    controller in symfony are split into several components. 1. It is the entry point into the application 2. It determines which action to execute 3. Loads the configurations 4. Executes the filters Creation of new symfony application creates two controllers. These are front controllers. 1. A controller for production environment (eg. frontend.php) 2. A controller for development environment (eg. frontend_dev.php) The differenece between the two is the debug information and error displaying
  6. MODEL The model layer represents the application data and the

    business rules to manipulate and access it symfony model layer is split into two separate layers : 1. Object Relation Layer(ORM) : ORM turns database tables, rows, and different variable types into objects. Symfony 1.4 incorporates doctrine 1.2 as default ORM 2. Data Abstraction Layer(DBAL) : Database abstraction means database portablity.
  7. VIEWS A view which is commonly referred as a template,

    is displayed to the user. These templates are completely separated from controllers and models
  8. GLMPSE OF SYMFONY 1.4 FEATURS 1. SYMFONY FORMS Using symfony

    , the development time is decreased due to the form sub framework There are two types of form:  Doctrine form is a form that is based on a database table(s) or model. These forms persist the submitted data to the table(s) that they are based on. This can be automatically generated using the symfony tasks  Simple form is a form that does not persist data to the database.
  9. 2. PLUGINS One of the best features of symfony is

    its plugin architecture. So many units of functionality can be written as a plugin and used time and again. A few useful plugins are: sfDoctrineGuardPlugin – ACL sfLucenePlugin – Indexing and Search SfAdminThemeJroller - ADMIN Theme SfFormExtra – Additional Widgets
  10. 3. Internationalization and Localization Many web applications offer local translations

    and services based on your locale. Symfony provides interfaces, standards, and localized helpers to make internationalization(i18N) and localization(110N) simple
  11. 3. Generators Symfony has generators which when run from a

    task on cli can scaffold forms on the frontend and also backend admin forms. These forms are based on a model. Not only forms but it also generates code to provide the ability to Create Retrieve Update and Delete (CRUD) records in the database.
  12. 5. Cache Cache is the fastest method of retrieving information.

    In Symfony, templates, partials, components and actions can all be cached to speed up the response time. Configurationof the cache also governed by a configuration file(cache.yml)
  13. 6. Testing Symfony provides ability for unit and functional testing.

    Symfony has its own testing framework called Lime. This testing framework can be useful for both unit and functional testing
  14. Coding Guidelines  Never use tabulations in the code. Indentation

    is done by steps of 2 spaces  Don't put spaces after an opening parenthesis and before a closing one.  Use camelCase, not underscores, for variable, function and method names  Use underscores for option/argument/parameter names.  Braces always go on their own line.  Use lowercase PHP native typed constants: false, true and null.  When comparing a variable to a string, put the string first and use type testing when applicable Further references from: http://trac.symfony- project.org/wiki/HowToContributeToSymfony#CodingStand ards