SlideShare ist ein Scribd-Unternehmen logo
1 von 119
Downloaden Sie, um offline zu lesen
Sympal - a CMS based on Symfony




                           Sympal
              Content Management System Based on Symfony




Jonathan H. Wage: Sympal a CMS Based on Symfony            1
Sympal - a CMS based on Symfony




        Sympal is a Content Management System built
        on top of Symfony and Doctrine.

        It is an evolution of many smaller CMS systems
        used in projects over the years.




Jonathan H. Wage: Sympal a CMS Based on Symfony          2
Sympal - a CMS based on Symfony


• Collection of Symfony plugins
   – sfSympalPlugin
       •   sfFeed2Plugin
       •   sfFormExtraPlugin
       •   sfSuperCachePlugin
       •   sfSympalMenuPlugin
       •   sfSympalPagesPlugin
       •   sfSympalPluginManagerPlugin
       •   sfSympalUserPlugin
       •   sfTaskExtraPlugin
       •   sfWebBrowserPlugin

Jonathan H. Wage: Sympal a CMS Based on Symfony   3
Sympal - a CMS based on Symfony




                      The Idea


Jonathan H. Wage: Sympal a CMS Based on Symfony   4
Sympal - a CMS based on Symfony



• The idea spawned from a need
• Custom functionality in Symfony is
  easy
• Standard CMS functionality is not
  so easy



Jonathan H. Wage: Sympal a CMS Based on Symfony   5
Sympal - a CMS based on Symfony


• A project with 75% custom functionality
  and 25% CMS functionality.
• The 75% custom is no problem
• But what about that 25%?
• It sometimes ends up taking more time
  than the 75% custom!
• We repeat ourselves a lot when it
  comes to CMS functionality

Jonathan H. Wage: Sympal a CMS Based on Symfony   6
Sympal - a CMS based on Symfony




 So the idea is to provide what something
like Drupal gives you with a powerful MVC
   framework and ORM under the hood.




Jonathan H. Wage: Sympal a CMS Based on Symfony   7
Sympal - a CMS based on Symfony




The name Sympal was coined by my friend
  and ex co-worker Josh Reynolds a few
years ago while brainstorming. Sympal was
 born that day and I began recording notes
   and collecting code from old projects.

           Symfony + Drupal = Sympal

 Jonathan H. Wage: Sympal a CMS Based on Symfony   8
Sympal - a CMS based on Symfony




  The code has existed in my own private
repositories for a long time but not until the
last few months have I started to formalize
   it in to a working product and made it
             available to the public



Jonathan H. Wage: Sympal a CMS Based on Symfony   9
Sympal - a CMS based on Symfony




                       Highlights



Jonathan H. Wage: Sympal a CMS Based on Symfony   10
Sympal - a CMS based on Symfony



• CLI or web installation
• Menus
• Breadcrumbs
• Content types
• Inline or backend content editing
• Content slots
• Plugin manager - Download/Install/Uninstall Sympal
  plugins from the CLI or web browser.
• Configuration controlled via YAML or a web form
• Security - users, groups and permissions
Jonathan H. Wage: Sympal a CMS Based on Symfony        11
Sympal - a CMS based on Symfony



•   Events
•   Sending E-Mail
•   Multiple Sites
•   Multiple Themes/Layouts
•   Internationalized URLs
•   Map menus to content
•   Change url of content without breaking old urls
•   SEO
•   Logged in user Dashboard
•   Uses YUI for JS framework
Jonathan H. Wage: Sympal a CMS Based on Symfony       12
Sympal - a CMS based on Symfony




                      Installation



Jonathan H. Wage: Sympal a CMS Based on Symfony   13
Sympal - a CMS based on Symfony



• Install from your browser
• Or from the command line
• Use in new or existing projects




Jonathan H. Wage: Sympal a CMS Based on Symfony   14
Sympal - a CMS based on Symfony


  Install from your browser




Jonathan H. Wage: Sympal a CMS Based on Symfony   15
Sympal - a CMS based on Symfony


• Install from the command line
$ php symfony sympal:install --interactive

• Interactive option prompts you for
  the same information as the
  browser installation
• Omit --interactive and default
  values will be used
Jonathan H. Wage: Sympal a CMS Based on Symfony   16
Sympal - a CMS based on Symfony



  Once installed you will see the
  default Sympal website.




Jonathan H. Wage: Sympal a CMS Based on Symfony   17
Sympal - a CMS based on Symfony




                            Menus



Jonathan H. Wage: Sympal a CMS Based on Symfony   18
Sympal - a CMS based on Symfony


• Only requires one query
• Multiple menus
• Sub-menus
• No matter how large or how
  complex they only ever require one
  query.
• Menus can optionally be cached for
  0 queries.
Jonathan H. Wage: Sympal a CMS Based on Symfony   19
Sympal - a CMS based on Symfony


  YUI tree view for managing menus




Jonathan H. Wage: Sympal a CMS Based on Symfony   20
Sympal - a CMS based on Symfony


  Drag and drop ordering




Jonathan H. Wage: Sympal a CMS Based on Symfony   21
Sympal - a CMS based on Symfony



  Right click a menu leaf to manage




Jonathan H. Wage: Sympal a CMS Based on Symfony   22
Sympal - a CMS based on Symfony



  Rendering menus is done with a
  Symfony helper

// returns instance of sfSympalMenuSite which extends sfSympalMenu
$menu = get_sympal_menu('footer');

// sfSympalMenu implements __toString() which invokes rendering
echo $menu;




Jonathan H. Wage: Sympal a CMS Based on Symfony                   23
Sympal - a CMS based on Symfony



  Use custom menu class

 class myMenuClass extends sfSympalMenuSite
 {

 }

 echo get_sympal_menu('footer', true, 'myMenuClass');




Jonathan H. Wage: Sympal a CMS Based on Symfony    24
Sympal - a CMS based on Symfony



• Specify global custom menu class
  in configuration

              all:
                sympal_config:
                   menu_class: myMenuClass



• Now all your menus use that class
Jonathan H. Wage: Sympal a CMS Based on Symfony   25
Sympal - a CMS based on Symfony



• Core of menu system is database
  agnostic
• sfSympalMenu implements the basic
  menu functionality
• sfSympalMenuSite extends
  sfSympalMenu and implements the
  binding to the Doctrine MenuItem
  model
Jonathan H. Wage: Sympal a CMS Based on Symfony   26
Sympal - a CMS based on Symfony



    Using sfSympalMenu standalone
$menu = new sfSympalMenu('My Test Menu');

$menu->addChild('Google', 'http://www.google.com');

$sensio = $menu->addChild('Sensio', 'http://www.sensio.com');
$sensio->addChild('Sensio Labs', 'http://www.sensiolabs.com');
$sensio->addChild('The Symfony MVC Framework', 'http://www.symfony-project.com');
$sensio->addChild('The Symfony Components', 'http://components.symfony-
project.org');
$sensio->addChild('The Doctrine ORM', 'http://www.doctrine-project.org');

$menu->addChild('Yahoo', 'http://www.yahoo.com');

echo $menu;



  Jonathan H. Wage: Sympal a CMS Based on Symfony                          27
Sympal - a CMS based on Symfony



• Serves multiple purposes
   – Breadcrumbs
   – Admin bar menu
   – Floating editor panel
• Building hierarchical structure
  through OO interface
• Rendering HTML for the hierarchy

Jonathan H. Wage: Sympal a CMS Based on Symfony   28
Sympal - a CMS based on Symfony


• Connect to events to alter these
  objects before they are rendered
• Sympal plugins can add items to
  the admin bar, menus, floating
  editor panel, etc.
• Install a Sympal plugin and the
  functionality appears in your site
  and is instantly available.
Jonathan H. Wage: Sympal a CMS Based on Symfony   29
Sympal - a CMS based on Symfony



• The rendering of menus are done through these functions
  which can be overridden and customized.
   – render()
   – renderChild()
   – renderChildBody()
   – renderLink()
   – renderLabel()
• Rendering is split in to multiple methods to allow you to
  override only the pieces you need to change.


Jonathan H. Wage: Sympal a CMS Based on Symfony               30
Sympal - a CMS based on Symfony



• Admin bar rendering is customized
  with sfSympalMenuAdminBar class

• Overrides renderChild() method so
  that the proper HTML is generated
  for YUI to work


Jonathan H. Wage: Sympal a CMS Based on Symfony   31
Sympal - a CMS based on Symfony




                   Breadcrumbs



Jonathan H. Wage: Sympal a CMS Based on Symfony   32
Sympal - a CMS based on Symfony



• Breadcrumbs don’t require any
  additional queries
• Generated from the same
  information used for menus
• Also generated with special child
  class of sfSympalMenuSite named
  sfSympalMenuBreadcrumbs
Jonathan H. Wage: Sympal a CMS Based on Symfony   33
Sympal - a CMS based on Symfony



  Rendering breadcrumbs are done with a Symfony helper,
  similar to the menus

    // Get the current menu item to render breadcrumbs for
    // Or render breadcrumbs for any Doctrine MenuItem instance
    $menuItem = sfSympalToolkit::getCurrentMenuItem();

    // Returns instance of sfSympalMenuBreadcrumbs
    $breadcrumbs = get_sympal_breadcrumbs($menuItem);

    echo $breadcrumbs;




Jonathan H. Wage: Sympal a CMS Based on Symfony                   34
Sympal - a CMS based on Symfony




                  Content Types



Jonathan H. Wage: Sympal a CMS Based on Symfony   35
Sympal - a CMS based on Symfony



• Sympal comes bundled with two
  content types
   – Page - Simple title and body
   – ContentList - Content type which allows you to specify
     information to render a list of another type of content.
       •   Specify the query
       •   Sorting
       •   Limit
       •   Conditions of list, etc.
       •   What template to render the list with
Jonathan H. Wage: Sympal a CMS Based on Symfony             36
Sympal - a CMS based on Symfony



• Easily add new content types
  through Sympal plugins
• Generate a new Sympal plugin that
  contains the skeleton for a new
  content type which can be installed



Jonathan H. Wage: Sympal a CMS Based on Symfony   37
Sympal - a CMS based on Symfony


  Generate the new Sympal plugin
$ php symfony sympal:plugin-generate Article --content-type=Article
          sfSympalArticlePlugin/
          
   config/
          
   
    doctrine/
          
   
    
   schema.yml
          
   
    routing.yml
          
   
    sfSympalArticlePluginConfiguration.class.php
          
   data/
          
   
    fixtures/
          
   
    
   install.yml
          
   lib/
          
   LICENSE
          
   package.xml.tmpl
          
   README

Jonathan H. Wage: Sympal a CMS Based on Symfony                  38
Sympal - a CMS based on Symfony


• Inspect the generated plugin
• Have a look at the default
  schema.yml created
             ---
             Article:
               actAs: [sfSympalContentType]
               columns:
                 title: string(255)
                 body: clob


Jonathan H. Wage: Sympal a CMS Based on Symfony   39
Sympal - a CMS based on Symfony

• Now we can install the generated plugin
$ php symfony sympal:plugin-install Article

• Installation does the following
   – Generates models, forms, etc. for schema
   – Creates tables in the database
   – Adds a sample content list for content type
   – Adds a sample content record for content type
   – Adds a menu item to the primary menu which is
     mapped to the content list for the new content
     type

Jonathan H. Wage: Sympal a CMS Based on Symfony   40
Sympal - a CMS based on Symfony


  When we go to add new content we
  can now add Articles




Jonathan H. Wage: Sympal a CMS Based on Symfony   41
Sympal - a CMS based on Symfony


  We can click the menu item added
  to the primary menu to view the list
  of articles.




Jonathan H. Wage: Sympal a CMS Based on Symfony   42
Sympal - a CMS based on Symfony



  Click the sample article to view it




Jonathan H. Wage: Sympal a CMS Based on Symfony   43
Sympal - a CMS based on Symfony


• Rendering of content types utilizes
  Content Templates
• Use different templates to render
  different content types
• Use different templates to render
  individual content records
• By default it just uses some basic
  templates
Jonathan H. Wage: Sympal a CMS Based on Symfony   44
Sympal - a CMS based on Symfony




                   Inline Editing



Jonathan H. Wage: Sympal a CMS Based on Symfony   45
Sympal - a CMS based on Symfony



  Sympal allows you to edit your
  content inline when logged in as an
  authorized content editor.




Jonathan H. Wage: Sympal a CMS Based on Symfony   46
Sympal - a CMS based on Symfony


  When you double click some
  content to edit the inline editor will
  come up




Jonathan H. Wage: Sympal a CMS Based on Symfony   47
Sympal - a CMS based on Symfony



  Edit model columns inline in
  addition to content slots




Jonathan H. Wage: Sympal a CMS Based on Symfony   48
Sympal - a CMS based on Symfony




                Plugin Manager



Jonathan H. Wage: Sympal a CMS Based on Symfony   49
Sympal - a CMS based on Symfony



• Download, install and uninstall plugins
• Works from the CLI or web browser
• Sympal plugin manager tries to get a
  plugin through the symfony
  plugin:install task first then tries to find
  the plugin in SVN and check it out


Jonathan H. Wage: Sympal a CMS Based on Symfony   50
Sympal - a CMS based on Symfony



  From the command line




Jonathan H. Wage: Sympal a CMS Based on Symfony   51
Sympal - a CMS based on Symfony



  From the web browser




Jonathan H. Wage: Sympal a CMS Based on Symfony   52
Sympal - a CMS based on Symfony




Jonathan H. Wage: Sympal a CMS Based on Symfony   53
Sympal - a CMS based on Symfony




                   Configuration



Jonathan H. Wage: Sympal a CMS Based on Symfony   54
Sympal - a CMS based on Symfony



  Controlled via YAML

      all:
        sympal_config:
           menu_class: sfSympalMenuSite
           yui_path: http://yui.yahooapis.com/2.7.0/build
           super_admin_signin_url: @sympal_dashboard
           enable_all_modules: true
           admin_module_web_dir: /sfSympalPlugin
           load_default_css: true




Jonathan H. Wage: Sympal a CMS Based on Symfony             55
Sympal - a CMS based on Symfony



• Or YAML can be controlled via a
  web form
• When configuration form is saved
  the YAML file is written




Jonathan H. Wage: Sympal a CMS Based on Symfony   56
Sympal - a CMS based on Symfony



• Since the configuration uses the
  symfony app.yml it can be controlled at
  different levels of symfony
   – Project
   – Application
   – Module




Jonathan H. Wage: Sympal a CMS Based on Symfony   57
Sympal - a CMS based on Symfony



• Other items related to content records can be
  configured at different levels. For example the
  layout can be controlled
   – Globally
   – Per site
   – Per content type
   – Per content record
• This means you can customize the layout an
  individual content record uses.

Jonathan H. Wage: Sympal a CMS Based on Symfony   58
Sympal - a CMS based on Symfony




                          Security



Jonathan H. Wage: Sympal a CMS Based on Symfony   59
Sympal - a CMS based on Symfony



• sfSympalUserPlugin is forked version of
  sfDoctrineGuardPlugin
   – Users
   – Groups
   – Permissions
   – Forgot Password
   – Registration

• Menus, content records, etc. can all be locked down with
  permissions.


Jonathan H. Wage: Sympal a CMS Based on Symfony          60
Sympal - a CMS based on Symfony



  List users




Jonathan H. Wage: Sympal a CMS Based on Symfony   61
Sympal - a CMS based on Symfony



  Edit users




Jonathan H. Wage: Sympal a CMS Based on Symfony   62
Sympal - a CMS based on Symfony



  List groups




Jonathan H. Wage: Sympal a CMS Based on Symfony   63
Sympal - a CMS based on Symfony



  Edit group




Jonathan H. Wage: Sympal a CMS Based on Symfony   64
Sympal - a CMS based on Symfony



  List permissions




Jonathan H. Wage: Sympal a CMS Based on Symfony   65
Sympal - a CMS based on Symfony



  Edit permission




Jonathan H. Wage: Sympal a CMS Based on Symfony   66
Sympal - a CMS based on Symfony




    Sympal Admin Generator
            Theme



Jonathan H. Wage: Sympal a CMS Based on Symfony   67
Sympal - a CMS based on Symfony



• Sympal comes with custom admin
  generator them
• Tabbed forms for fieldsets and
  embedded forms




Jonathan H. Wage: Sympal a CMS Based on Symfony   68
Sympal - a CMS based on Symfony



  Easily click Filters to popup the
  filters form




Jonathan H. Wage: Sympal a CMS Based on Symfony   69
Sympal - a CMS based on Symfony




         Floating Editor Panel



Jonathan H. Wage: Sympal a CMS Based on Symfony   70
Sympal - a CMS based on Symfony



  When logged in as editor and viewing a content
  record a floating editor panel is displayed




Jonathan H. Wage: Sympal a CMS Based on Symfony   71
Sympal - a CMS based on Symfony




            Content Slot Types



Jonathan H. Wage: Sympal a CMS Based on Symfony   72
Sympal - a CMS based on Symfony



• A content slot in Sympal is an
  arbitrary piece of content and has a
  type.

• Sympal comes bundled with a few
  content slot types


Jonathan H. Wage: Sympal a CMS Based on Symfony   73
Sympal - a CMS based on Symfony



• The default slot types offered by
  Sympal are
   – Markdown
   – MultiLineText
   – RichText
   – Text
• Add your own custom slot types for
  your projects
Jonathan H. Wage: Sympal a CMS Based on Symfony   74
Sympal - a CMS based on Symfony




           YUI Rich Text Editor



Jonathan H. Wage: Sympal a CMS Based on Symfony   75
Sympal - a CMS based on Symfony



  The RichText slot type uses the YUI
  rich text editor




Jonathan H. Wage: Sympal a CMS Based on Symfony   76
Sympal - a CMS based on Symfony



  The YUI rich text editor also
  implements the ability to upload
  and embed images inline




Jonathan H. Wage: Sympal a CMS Based on Symfony   77
Sympal - a CMS based on Symfony




               Sending E-Mails



Jonathan H. Wage: Sympal a CMS Based on Symfony   78
Sympal - a CMS based on Symfony



• A reoccurring need
• Re-implementing the functionality
  over and over wasting time
• We need a standard way to send
  and manage our e-mail templates
• Sympal offers a solution

Jonathan H. Wage: Sympal a CMS Based on Symfony   79
Sympal - a CMS based on Symfony



  In your actions you can easily
  create new e-mails and send them
       class my_moduleActions extends sfActions
       {
         public function executeSome_action(sfWebRequest $request)
         {
           $variables = array(
              'name' => 'Jonathan H. Wage'
           );
           $email = $this->newEmail('email_module/test', $variables);
           $email->send('jonwage@gmail.com');
         }
       }



Jonathan H. Wage: Sympal a CMS Based on Symfony                         80
Sympal - a CMS based on Symfony



 • The templates used for a Sympal e-
   mail are just a partial or component
 • In the previous example we use a
   partial named _test.php
Hello <?php echo $name ?>,
This is a test e-mail that we are sending to <?php echo $name ?>




 Jonathan H. Wage: Sympal a CMS Based on Symfony           81
Sympal - a CMS based on Symfony



• The first line of the template is the
  subject
• The second line and after is the
  body of the e-mail
• This way the contents of the e-
  mail(subject and body) are
  managed in one place
Jonathan H. Wage: Sympal a CMS Based on Symfony   82
Sympal - a CMS based on Symfony



• The newEmail() method returns an
  instance of sfSympalMail

• sfSympalMail is a wrapper around
  your mail sending program which
  defaults to Swift in Sympal


Jonathan H. Wage: Sympal a CMS Based on Symfony   83
Sympal - a CMS based on Symfony




                   Multiple Sites



Jonathan H. Wage: Sympal a CMS Based on Symfony   84
Sympal - a CMS based on Symfony


• Sympal can handle multiple sites

• A sympal site is directly bound to a
  symfony application

• This is how Sympal knows which
  site you are in and can limit the
  data to only that site
Jonathan H. Wage: Sympal a CMS Based on Symfony   85
Sympal - a CMS based on Symfony




Jonathan H. Wage: Sympal a CMS Based on Symfony   86
Sympal - a CMS based on Symfony




Search Engine Optimization



Jonathan H. Wage: Sympal a CMS Based on Symfony   87
Sympal - a CMS based on Symfony



• SEO capabilities are built in
• You can specify global title,
  keywords and description for your
  project.
• They can also be overridden by
  each site or even by individual
  content records
Jonathan H. Wage: Sympal a CMS Based on Symfony   88
Sympal - a CMS based on Symfony


• sfSympalAutoSEOPlugin
   – Who is going to write it? :)
   – Automatically generate SEO for content
     records from the final rendered HTML
       • Parse the first <h1> tag value for the meta title
       • Build a list of top words used in the content
         record for the meta keywords
       • Parse the first <p> tag value for the meta
         description
   – Write good content and you’ll have SEO

Jonathan H. Wage: Sympal a CMS Based on Symfony          89
Sympal - a CMS based on Symfony




                      Dashboard



Jonathan H. Wage: Sympal a CMS Based on Symfony   90
Sympal - a CMS based on Symfony



  When a user logs in and has some credentials he’ll be
  forwarded to his dashboard. A super administrator would
  see everything. Something like the below...




Jonathan H. Wage: Sympal a CMS Based on Symfony             91
Sympal - a CMS based on Symfony



• Dashboard is generated using the
  sfSympalMenu classes

• The menu instance used to
  generate the dashboard is passed
  through an event so you can easily
  add to it by connecting to an event
Jonathan H. Wage: Sympal a CMS Based on Symfony   92
Sympal - a CMS based on Symfony



  Connect to dashboard event and
  add to the menu object
           class sfSympalTestPluginConfiguration extends sfPluginConfiguration
           {
             public function initialize()
             {
               $this->dispatcher->connect('sympal.load_dashboard_boxes',
                  array($this, 'loadDashboardBoxes')
               );
             }

               public function loadDashboardBoxes(sfEvent $event)
               {
                 $menu = $event['menu'];
                 $menu->addChild('My New Box', '@route_name');
               }
           }




Jonathan H. Wage: Sympal a CMS Based on Symfony                                  93
Sympal - a CMS based on Symfony




               Multiple Themes



Jonathan H. Wage: Sympal a CMS Based on Symfony   94
Sympal - a CMS based on Symfony



• Sympal offers the ability to have
  themes and you can configure in
  multiple places what them to use
   – Globally
   – Per site
   – Per content type
   – Or per content record


Jonathan H. Wage: Sympal a CMS Based on Symfony   95
Sympal - a CMS based on Symfony



• We can now easily have Sympal theme plugins
  that you can download and instantly have a
  new theme to change to
• We already have three themes available that
  you can download and use
   – sfSympalPlugin - The default theme included with
     Sympal
   – sfSympalJwageThemePlugin - The theme used on my
     personal website, jwage.com
   – sfSympalDoctrineThemePlugin - The theme which
     powers the Doctrine website
Jonathan H. Wage: Sympal a CMS Based on Symfony     96
Sympal - a CMS based on Symfony

        Doctrine Theme




        Sympal Theme




Jonathan H. Wage: Sympal a CMS Based on Symfony   97
Sympal - a CMS based on Symfony




             Sympal CLI Tasks



Jonathan H. Wage: Sympal a CMS Based on Symfony   98
Sympal - a CMS based on Symfony



  Sympal comes with some other
  pretty useful tasks for improving
  your productivity when working in
  Symfony




Jonathan H. Wage: Sympal a CMS Based on Symfony   99
Sympal - a CMS based on Symfony


• Most notable CLI tasks
  – sympal:delete-model - Delete a model from your
    project. Finds and deletes model, form and filter files all
    in one command
  – sympal:report-statistics - This task will report back to the
    Symfony Plugins API what all plugins you’re using in
    your project and will add them to your stack.
  – sympal:event-list - Report a list of events that are
    available for a URL in your application
      • See who has connected to an event

 Jonathan H. Wage: Sympal a CMS Based on Symfony          100
Sympal - a CMS based on Symfony



  Show a list of all available events
  for a URL




Jonathan H. Wage: Sympal a CMS Based on Symfony   101
Sympal - a CMS based on Symfony



  Show only the events which have
  been connected to




Jonathan H. Wage: Sympal a CMS Based on Symfony   102
Sympal - a CMS based on Symfony



  Inspect an individual event to see
  who has connected to it and more
  importantly where!




Jonathan H. Wage: Sympal a CMS Based on Symfony   103
Sympal - a CMS based on Symfony




      More on Sympal Events



Jonathan H. Wage: Sympal a CMS Based on Symfony   104
Sympal - a CMS based on Symfony



• Some might say I have overused
  the Symfony events system in
  Sympal

• But, I really like it and I find it very
  useful in the CMS context. It allows
  for things to be very flexible and
  “changeable” by use of events.
Jonathan H. Wage: Sympal a CMS Based on Symfony   105
Sympal - a CMS based on Symfony



• A re-occurring question
   – How can I add to a model of another plugin,
     or a model in my project from a plugin.

   – Before Sympal this was not possible but now
     if you models simply actAs sfSympalRecord
     or sfSympalContentType you can connect to
     an event which is notified during the setup of
     a Doctrine model

Jonathan H. Wage: Sympal a CMS Based on Symfony   106
Sympal - a CMS based on Symfony



• Add a new column to the Sympal User
  model
• The schema for the model looks like
  this User:
              tableName: users
              actAs: [Timestampable, sfSympalRecord]
              columns:
                first_name: string(255)
                last_name: string(255)
            # ...


Jonathan H. Wage: Sympal a CMS Based on Symfony        107
Sympal - a CMS based on Symfony



• The actAs: [sfSympalRecord]
  allows us to connect to two events
   – sympal.user.set_table_definition
   – sympal.user.set_up
• The set table definition allows us to
  add new columns, indexes, etc.
• The set up allows us to add
  relationships, add behaviors, etc.
Jonathan H. Wage: Sympal a CMS Based on Symfony   108
Sympal - a CMS based on Symfony


  Now lets connect to the set table
  definition event and add a new column
  class sfSympalTestPluginConfiguration extends sfPluginConfiguration
  {
    public function initialize()
    {
      $this->dispatcher->connect('sympal.user.set_table_definition',
         array($this, 'setUserTableDefinition')
      );
    }

      public function setUserTableDefinition(sfEvent $event)
      {
        $model = $event->getSubject();
        $model->hasColumn('my_new_column', 'string', 255);
      }
  }

Jonathan H. Wage: Sympal a CMS Based on Symfony                         109
Sympal - a CMS based on Symfony



• We have a lot more events and I can’t talk about them all
• But I will try and list some of the other notable events
   –   sympal.user.pre_signin
   –   sympal.user.post_signin
   –   sympal.load_breadcrumbs
   –   sympal.<model_name>.method_not_found
   –   sympal.post_render_page_content
   –   sympal.load_tools




Jonathan H. Wage: Sympal a CMS Based on Symfony          110
Sympal - a CMS based on Symfony



  With the Symfony events and the PHP __call()
  magic function we can fake “extending” a class
  by invoking a method_not_found event and
  letting users connect to it
     class sfSympalTestPluginConfiguration extends sfPluginConfiguration
     {
       public function initialize()
       {
         $this->dispatcher->connect('sympal.user.method_not_found',
            array(new myUserExtension(), 'extend')
         );
       }
     }



Jonathan H. Wage: Sympal a CMS Based on Symfony                            111
Sympal - a CMS based on Symfony



  Now lets define the
  myUserExtension class and add
  some new functionality
  class myUserExtension extends sfSympalExtendClass
  {
    public function getFullName()
    {
      return trim($this->getFirstName().' '.$this->getLastName());
    }
  }



Jonathan H. Wage: Sympal a CMS Based on Symfony                 112
Sympal - a CMS based on Symfony



  Now when I work with a User model
  instance I will be able to access my
  getFullName() method

          $user = new User();
          $user->first_name = 'Jonathan';
          $user->last_name = 'Wage';

          echo $user->getFullName(); // Jonathan Wage



Jonathan H. Wage: Sympal a CMS Based on Symfony         113
Sympal - a CMS based on Symfony




                   What is next?



Jonathan H. Wage: Sympal a CMS Based on Symfony   114
Sympal - a CMS based on Symfony



• Continued development of Sympal

• Work towards a 1.0 release

• Spread the word and try and get as
  much feedback as possible

Jonathan H. Wage: Sympal a CMS Based on Symfony   115
Sympal - a CMS based on Symfony




             What do we need?



Jonathan H. Wage: Sympal a CMS Based on Symfony   116
Sympal - a CMS based on Symfony



• Users, testers, feedback, etc.

• Development help, documentation
  help

• For development, we need the
  most help with the frontend
Jonathan H. Wage: Sympal a CMS Based on Symfony   117
Sympal - a CMS based on Symfony



• Frontend development
   – YUI/JS/CSS guru
   – Usability guru
• Backend development
   – Familiarity with Symfony and Doctrine
     obviously
   – Familiarity with other popular CMS in any
     other languages to help with functionality and
     implementation
Jonathan H. Wage: Sympal a CMS Based on Symfony   118
Sympal - a CMS based on Symfony


                         Questions?
       Jonathan H. Wage
       jonathan.wage@sensio.com
       +1 415 992 5468

       sensiolabs.com | doctrine-project.org | sympalphp.org | jwage.com



You can contact Jonathan about Doctrine and Open-Source or
 for training, consulting, application development, or business
        related questions at jonathan.wage@sensio.com


Jonathan H. Wage: Sympal a CMS Based on Symfony                            119

Weitere ähnliche Inhalte

Andere mochten auch

Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Paul Seiffert
 
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3Tomáš Votruba
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projectsIgnacio Martín
 
Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017Colin O'Dell
 
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformSébastien Morel
 
PHP 7.x - past, present, future
PHP 7.x - past, present, futurePHP 7.x - past, present, future
PHP 7.x - past, present, futureBoyan Yordanov
 

Andere mochten auch (11)

Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14Symfony und Ember.js auf einer Seite #codetalks14
Symfony und Ember.js auf einer Seite #codetalks14
 
Drupal8 for Symfony Developers
Drupal8 for Symfony DevelopersDrupal8 for Symfony Developers
Drupal8 for Symfony Developers
 
Matters of State
Matters of StateMatters of State
Matters of State
 
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
 
Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017Debugging Effectively - PHP UK 2017
Debugging Effectively - PHP UK 2017
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 
PHP 7.x - past, present, future
PHP 7.x - past, present, futurePHP 7.x - past, present, future
PHP 7.x - past, present, future
 

Ähnlich wie Sympal CMS Built on Symfony

Sympal The Flexible Symfony Cms
Sympal The Flexible Symfony CmsSympal The Flexible Symfony Cms
Sympal The Flexible Symfony Cmsnarkoza
 
Sympal - The Flexible Symfony Cms
Sympal - The Flexible Symfony CmsSympal - The Flexible Symfony Cms
Sympal - The Flexible Symfony CmsJonathan Wage
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Les-Tilleuls.coop
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Fabien Potencier
 
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
 
Drupal 8, Symfony and Content Management
Drupal 8, Symfony and Content ManagementDrupal 8, Symfony and Content Management
Drupal 8, Symfony and Content ManagementExove
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherLes-Tilleuls.coop
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep diveSalma Ghareeb
 
Create a Symfony Application from a Drupal Perspective
Create a Symfony Application from a Drupal PerspectiveCreate a Symfony Application from a Drupal Perspective
Create a Symfony Application from a Drupal PerspectiveAcquia
 
extending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsextending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsMatthew Soucoup
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Yury Pliashkou
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to SymfonyPixel Federation
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your OwnLambert Beekhuis
 
Eine Symfony Application um CMS-Funktionen erweitern
Eine Symfony Application um CMS-Funktionen erweiternEine Symfony Application um CMS-Funktionen erweitern
Eine Symfony Application um CMS-Funktionen erweiternMaximilian Berghoff
 
How to Clear Cache in a Symfony Cross Application
How to Clear Cache in a Symfony Cross ApplicationHow to Clear Cache in a Symfony Cross Application
How to Clear Cache in a Symfony Cross ApplicationMike Taylor
 
Setting advanced PHP development environment
Setting advanced PHP development environmentSetting advanced PHP development environment
Setting advanced PHP development environmentKapil Sharma
 

Ähnlich wie Sympal CMS Built on Symfony (20)

Sympal The Flexible Symfony Cms
Sympal The Flexible Symfony CmsSympal The Flexible Symfony Cms
Sympal The Flexible Symfony Cms
 
Sympal - The Flexible Symfony Cms
Sympal - The Flexible Symfony CmsSympal - The Flexible Symfony Cms
Sympal - The Flexible Symfony Cms
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
Drupal 8, Symfony and Content Management
Drupal 8, Symfony and Content ManagementDrupal 8, Symfony and Content Management
Drupal 8, Symfony and Content Management
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, Panther
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
 
Create a Symfony Application from a Drupal Perspective
Create a Symfony Application from a Drupal PerspectiveCreate a Symfony Application from a Drupal Perspective
Create a Symfony Application from a Drupal Perspective
 
extending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-appsextending-and-optimizing-xamarin-forms-apps
extending-and-optimizing-xamarin-forms-apps
 
Wampserver install
Wampserver installWampserver install
Wampserver install
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to Symfony
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Eine Symfony Application um CMS-Funktionen erweitern
Eine Symfony Application um CMS-Funktionen erweiternEine Symfony Application um CMS-Funktionen erweitern
Eine Symfony Application um CMS-Funktionen erweitern
 
How to Clear Cache in a Symfony Cross Application
How to Clear Cache in a Symfony Cross ApplicationHow to Clear Cache in a Symfony Cross Application
How to Clear Cache in a Symfony Cross Application
 
ReactPHP: practical intro
ReactPHP:  practical introReactPHP:  practical intro
ReactPHP: practical intro
 
симфони это не страшно
симфони   это не страшносимфони   это не страшно
симфони это не страшно
 
Setting advanced PHP development environment
Setting advanced PHP development environmentSetting advanced PHP development environment
Setting advanced PHP development environment
 

Mehr von Jonathan Wage

Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
OpenSky Infrastructure
OpenSky InfrastructureOpenSky Infrastructure
OpenSky InfrastructureJonathan Wage
 
Doctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 ParisDoctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 ParisJonathan Wage
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Doctrine in the Real World
Doctrine in the Real WorldDoctrine in the Real World
Doctrine in the Real WorldJonathan Wage
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMJonathan Wage
 
ZendCon2010 The Doctrine Project
ZendCon2010 The Doctrine ProjectZendCon2010 The Doctrine Project
ZendCon2010 The Doctrine ProjectJonathan Wage
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMJonathan Wage
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperJonathan Wage
 
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationSymfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationJonathan Wage
 
Doctrine 2 - Enterprise Persistence Layer For PHP
Doctrine 2 - Enterprise Persistence Layer For PHPDoctrine 2 - Enterprise Persistence Layer For PHP
Doctrine 2 - Enterprise Persistence Layer For PHPJonathan Wage
 
Introduction To Doctrine 2
Introduction To Doctrine 2Introduction To Doctrine 2
Introduction To Doctrine 2Jonathan Wage
 
Doctrine 2 - Not The Same Old Php Orm
Doctrine 2 - Not The Same Old Php OrmDoctrine 2 - Not The Same Old Php Orm
Doctrine 2 - Not The Same Old Php OrmJonathan Wage
 
Doctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPDoctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPJonathan Wage
 
Symfony 1.3 + Doctrine 1.2
Symfony 1.3 + Doctrine 1.2Symfony 1.3 + Doctrine 1.2
Symfony 1.3 + Doctrine 1.2Jonathan Wage
 
Sympal - The flexible Symfony CMS
Sympal - The flexible Symfony CMSSympal - The flexible Symfony CMS
Sympal - The flexible Symfony CMSJonathan Wage
 
What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in DoctrineJonathan Wage
 
Doctrine Php Object Relational Mapper
Doctrine Php Object Relational MapperDoctrine Php Object Relational Mapper
Doctrine Php Object Relational MapperJonathan Wage
 

Mehr von Jonathan Wage (20)

Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
OpenSky Infrastructure
OpenSky InfrastructureOpenSky Infrastructure
OpenSky Infrastructure
 
Doctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 ParisDoctrine In The Real World sflive2011 Paris
Doctrine In The Real World sflive2011 Paris
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Doctrine in the Real World
Doctrine in the Real WorldDoctrine in the Real World
Doctrine in the Real World
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 
ZendCon2010 The Doctrine Project
ZendCon2010 The Doctrine ProjectZendCon2010 The Doctrine Project
ZendCon2010 The Doctrine Project
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
 
Libertyvasion2010
Libertyvasion2010Libertyvasion2010
Libertyvasion2010
 
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationSymfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 Integration
 
Doctrine 2 - Enterprise Persistence Layer For PHP
Doctrine 2 - Enterprise Persistence Layer For PHPDoctrine 2 - Enterprise Persistence Layer For PHP
Doctrine 2 - Enterprise Persistence Layer For PHP
 
Introduction To Doctrine 2
Introduction To Doctrine 2Introduction To Doctrine 2
Introduction To Doctrine 2
 
Doctrine 2 - Not The Same Old Php Orm
Doctrine 2 - Not The Same Old Php OrmDoctrine 2 - Not The Same Old Php Orm
Doctrine 2 - Not The Same Old Php Orm
 
Doctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPDoctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHP
 
Symfony 1.3 + Doctrine 1.2
Symfony 1.3 + Doctrine 1.2Symfony 1.3 + Doctrine 1.2
Symfony 1.3 + Doctrine 1.2
 
Sympal - The flexible Symfony CMS
Sympal - The flexible Symfony CMSSympal - The flexible Symfony CMS
Sympal - The flexible Symfony CMS
 
What's new in Doctrine
What's new in DoctrineWhat's new in Doctrine
What's new in Doctrine
 
What Is Doctrine?
What Is Doctrine?What Is Doctrine?
What Is Doctrine?
 
Doctrine Php Object Relational Mapper
Doctrine Php Object Relational MapperDoctrine Php Object Relational Mapper
Doctrine Php Object Relational Mapper
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Sympal CMS Built on Symfony

  • 1. Sympal - a CMS based on Symfony Sympal Content Management System Based on Symfony Jonathan H. Wage: Sympal a CMS Based on Symfony 1
  • 2. Sympal - a CMS based on Symfony Sympal is a Content Management System built on top of Symfony and Doctrine. It is an evolution of many smaller CMS systems used in projects over the years. Jonathan H. Wage: Sympal a CMS Based on Symfony 2
  • 3. Sympal - a CMS based on Symfony • Collection of Symfony plugins – sfSympalPlugin • sfFeed2Plugin • sfFormExtraPlugin • sfSuperCachePlugin • sfSympalMenuPlugin • sfSympalPagesPlugin • sfSympalPluginManagerPlugin • sfSympalUserPlugin • sfTaskExtraPlugin • sfWebBrowserPlugin Jonathan H. Wage: Sympal a CMS Based on Symfony 3
  • 4. Sympal - a CMS based on Symfony The Idea Jonathan H. Wage: Sympal a CMS Based on Symfony 4
  • 5. Sympal - a CMS based on Symfony • The idea spawned from a need • Custom functionality in Symfony is easy • Standard CMS functionality is not so easy Jonathan H. Wage: Sympal a CMS Based on Symfony 5
  • 6. Sympal - a CMS based on Symfony • A project with 75% custom functionality and 25% CMS functionality. • The 75% custom is no problem • But what about that 25%? • It sometimes ends up taking more time than the 75% custom! • We repeat ourselves a lot when it comes to CMS functionality Jonathan H. Wage: Sympal a CMS Based on Symfony 6
  • 7. Sympal - a CMS based on Symfony So the idea is to provide what something like Drupal gives you with a powerful MVC framework and ORM under the hood. Jonathan H. Wage: Sympal a CMS Based on Symfony 7
  • 8. Sympal - a CMS based on Symfony The name Sympal was coined by my friend and ex co-worker Josh Reynolds a few years ago while brainstorming. Sympal was born that day and I began recording notes and collecting code from old projects. Symfony + Drupal = Sympal Jonathan H. Wage: Sympal a CMS Based on Symfony 8
  • 9. Sympal - a CMS based on Symfony The code has existed in my own private repositories for a long time but not until the last few months have I started to formalize it in to a working product and made it available to the public Jonathan H. Wage: Sympal a CMS Based on Symfony 9
  • 10. Sympal - a CMS based on Symfony Highlights Jonathan H. Wage: Sympal a CMS Based on Symfony 10
  • 11. Sympal - a CMS based on Symfony • CLI or web installation • Menus • Breadcrumbs • Content types • Inline or backend content editing • Content slots • Plugin manager - Download/Install/Uninstall Sympal plugins from the CLI or web browser. • Configuration controlled via YAML or a web form • Security - users, groups and permissions Jonathan H. Wage: Sympal a CMS Based on Symfony 11
  • 12. Sympal - a CMS based on Symfony • Events • Sending E-Mail • Multiple Sites • Multiple Themes/Layouts • Internationalized URLs • Map menus to content • Change url of content without breaking old urls • SEO • Logged in user Dashboard • Uses YUI for JS framework Jonathan H. Wage: Sympal a CMS Based on Symfony 12
  • 13. Sympal - a CMS based on Symfony Installation Jonathan H. Wage: Sympal a CMS Based on Symfony 13
  • 14. Sympal - a CMS based on Symfony • Install from your browser • Or from the command line • Use in new or existing projects Jonathan H. Wage: Sympal a CMS Based on Symfony 14
  • 15. Sympal - a CMS based on Symfony Install from your browser Jonathan H. Wage: Sympal a CMS Based on Symfony 15
  • 16. Sympal - a CMS based on Symfony • Install from the command line $ php symfony sympal:install --interactive • Interactive option prompts you for the same information as the browser installation • Omit --interactive and default values will be used Jonathan H. Wage: Sympal a CMS Based on Symfony 16
  • 17. Sympal - a CMS based on Symfony Once installed you will see the default Sympal website. Jonathan H. Wage: Sympal a CMS Based on Symfony 17
  • 18. Sympal - a CMS based on Symfony Menus Jonathan H. Wage: Sympal a CMS Based on Symfony 18
  • 19. Sympal - a CMS based on Symfony • Only requires one query • Multiple menus • Sub-menus • No matter how large or how complex they only ever require one query. • Menus can optionally be cached for 0 queries. Jonathan H. Wage: Sympal a CMS Based on Symfony 19
  • 20. Sympal - a CMS based on Symfony YUI tree view for managing menus Jonathan H. Wage: Sympal a CMS Based on Symfony 20
  • 21. Sympal - a CMS based on Symfony Drag and drop ordering Jonathan H. Wage: Sympal a CMS Based on Symfony 21
  • 22. Sympal - a CMS based on Symfony Right click a menu leaf to manage Jonathan H. Wage: Sympal a CMS Based on Symfony 22
  • 23. Sympal - a CMS based on Symfony Rendering menus is done with a Symfony helper // returns instance of sfSympalMenuSite which extends sfSympalMenu $menu = get_sympal_menu('footer'); // sfSympalMenu implements __toString() which invokes rendering echo $menu; Jonathan H. Wage: Sympal a CMS Based on Symfony 23
  • 24. Sympal - a CMS based on Symfony Use custom menu class class myMenuClass extends sfSympalMenuSite { } echo get_sympal_menu('footer', true, 'myMenuClass'); Jonathan H. Wage: Sympal a CMS Based on Symfony 24
  • 25. Sympal - a CMS based on Symfony • Specify global custom menu class in configuration all: sympal_config: menu_class: myMenuClass • Now all your menus use that class Jonathan H. Wage: Sympal a CMS Based on Symfony 25
  • 26. Sympal - a CMS based on Symfony • Core of menu system is database agnostic • sfSympalMenu implements the basic menu functionality • sfSympalMenuSite extends sfSympalMenu and implements the binding to the Doctrine MenuItem model Jonathan H. Wage: Sympal a CMS Based on Symfony 26
  • 27. Sympal - a CMS based on Symfony Using sfSympalMenu standalone $menu = new sfSympalMenu('My Test Menu'); $menu->addChild('Google', 'http://www.google.com'); $sensio = $menu->addChild('Sensio', 'http://www.sensio.com'); $sensio->addChild('Sensio Labs', 'http://www.sensiolabs.com'); $sensio->addChild('The Symfony MVC Framework', 'http://www.symfony-project.com'); $sensio->addChild('The Symfony Components', 'http://components.symfony- project.org'); $sensio->addChild('The Doctrine ORM', 'http://www.doctrine-project.org'); $menu->addChild('Yahoo', 'http://www.yahoo.com'); echo $menu; Jonathan H. Wage: Sympal a CMS Based on Symfony 27
  • 28. Sympal - a CMS based on Symfony • Serves multiple purposes – Breadcrumbs – Admin bar menu – Floating editor panel • Building hierarchical structure through OO interface • Rendering HTML for the hierarchy Jonathan H. Wage: Sympal a CMS Based on Symfony 28
  • 29. Sympal - a CMS based on Symfony • Connect to events to alter these objects before they are rendered • Sympal plugins can add items to the admin bar, menus, floating editor panel, etc. • Install a Sympal plugin and the functionality appears in your site and is instantly available. Jonathan H. Wage: Sympal a CMS Based on Symfony 29
  • 30. Sympal - a CMS based on Symfony • The rendering of menus are done through these functions which can be overridden and customized. – render() – renderChild() – renderChildBody() – renderLink() – renderLabel() • Rendering is split in to multiple methods to allow you to override only the pieces you need to change. Jonathan H. Wage: Sympal a CMS Based on Symfony 30
  • 31. Sympal - a CMS based on Symfony • Admin bar rendering is customized with sfSympalMenuAdminBar class • Overrides renderChild() method so that the proper HTML is generated for YUI to work Jonathan H. Wage: Sympal a CMS Based on Symfony 31
  • 32. Sympal - a CMS based on Symfony Breadcrumbs Jonathan H. Wage: Sympal a CMS Based on Symfony 32
  • 33. Sympal - a CMS based on Symfony • Breadcrumbs don’t require any additional queries • Generated from the same information used for menus • Also generated with special child class of sfSympalMenuSite named sfSympalMenuBreadcrumbs Jonathan H. Wage: Sympal a CMS Based on Symfony 33
  • 34. Sympal - a CMS based on Symfony Rendering breadcrumbs are done with a Symfony helper, similar to the menus // Get the current menu item to render breadcrumbs for // Or render breadcrumbs for any Doctrine MenuItem instance $menuItem = sfSympalToolkit::getCurrentMenuItem(); // Returns instance of sfSympalMenuBreadcrumbs $breadcrumbs = get_sympal_breadcrumbs($menuItem); echo $breadcrumbs; Jonathan H. Wage: Sympal a CMS Based on Symfony 34
  • 35. Sympal - a CMS based on Symfony Content Types Jonathan H. Wage: Sympal a CMS Based on Symfony 35
  • 36. Sympal - a CMS based on Symfony • Sympal comes bundled with two content types – Page - Simple title and body – ContentList - Content type which allows you to specify information to render a list of another type of content. • Specify the query • Sorting • Limit • Conditions of list, etc. • What template to render the list with Jonathan H. Wage: Sympal a CMS Based on Symfony 36
  • 37. Sympal - a CMS based on Symfony • Easily add new content types through Sympal plugins • Generate a new Sympal plugin that contains the skeleton for a new content type which can be installed Jonathan H. Wage: Sympal a CMS Based on Symfony 37
  • 38. Sympal - a CMS based on Symfony Generate the new Sympal plugin $ php symfony sympal:plugin-generate Article --content-type=Article sfSympalArticlePlugin/ config/ doctrine/ schema.yml routing.yml sfSympalArticlePluginConfiguration.class.php data/ fixtures/ install.yml lib/ LICENSE package.xml.tmpl README Jonathan H. Wage: Sympal a CMS Based on Symfony 38
  • 39. Sympal - a CMS based on Symfony • Inspect the generated plugin • Have a look at the default schema.yml created --- Article: actAs: [sfSympalContentType] columns: title: string(255) body: clob Jonathan H. Wage: Sympal a CMS Based on Symfony 39
  • 40. Sympal - a CMS based on Symfony • Now we can install the generated plugin $ php symfony sympal:plugin-install Article • Installation does the following – Generates models, forms, etc. for schema – Creates tables in the database – Adds a sample content list for content type – Adds a sample content record for content type – Adds a menu item to the primary menu which is mapped to the content list for the new content type Jonathan H. Wage: Sympal a CMS Based on Symfony 40
  • 41. Sympal - a CMS based on Symfony When we go to add new content we can now add Articles Jonathan H. Wage: Sympal a CMS Based on Symfony 41
  • 42. Sympal - a CMS based on Symfony We can click the menu item added to the primary menu to view the list of articles. Jonathan H. Wage: Sympal a CMS Based on Symfony 42
  • 43. Sympal - a CMS based on Symfony Click the sample article to view it Jonathan H. Wage: Sympal a CMS Based on Symfony 43
  • 44. Sympal - a CMS based on Symfony • Rendering of content types utilizes Content Templates • Use different templates to render different content types • Use different templates to render individual content records • By default it just uses some basic templates Jonathan H. Wage: Sympal a CMS Based on Symfony 44
  • 45. Sympal - a CMS based on Symfony Inline Editing Jonathan H. Wage: Sympal a CMS Based on Symfony 45
  • 46. Sympal - a CMS based on Symfony Sympal allows you to edit your content inline when logged in as an authorized content editor. Jonathan H. Wage: Sympal a CMS Based on Symfony 46
  • 47. Sympal - a CMS based on Symfony When you double click some content to edit the inline editor will come up Jonathan H. Wage: Sympal a CMS Based on Symfony 47
  • 48. Sympal - a CMS based on Symfony Edit model columns inline in addition to content slots Jonathan H. Wage: Sympal a CMS Based on Symfony 48
  • 49. Sympal - a CMS based on Symfony Plugin Manager Jonathan H. Wage: Sympal a CMS Based on Symfony 49
  • 50. Sympal - a CMS based on Symfony • Download, install and uninstall plugins • Works from the CLI or web browser • Sympal plugin manager tries to get a plugin through the symfony plugin:install task first then tries to find the plugin in SVN and check it out Jonathan H. Wage: Sympal a CMS Based on Symfony 50
  • 51. Sympal - a CMS based on Symfony From the command line Jonathan H. Wage: Sympal a CMS Based on Symfony 51
  • 52. Sympal - a CMS based on Symfony From the web browser Jonathan H. Wage: Sympal a CMS Based on Symfony 52
  • 53. Sympal - a CMS based on Symfony Jonathan H. Wage: Sympal a CMS Based on Symfony 53
  • 54. Sympal - a CMS based on Symfony Configuration Jonathan H. Wage: Sympal a CMS Based on Symfony 54
  • 55. Sympal - a CMS based on Symfony Controlled via YAML all: sympal_config: menu_class: sfSympalMenuSite yui_path: http://yui.yahooapis.com/2.7.0/build super_admin_signin_url: @sympal_dashboard enable_all_modules: true admin_module_web_dir: /sfSympalPlugin load_default_css: true Jonathan H. Wage: Sympal a CMS Based on Symfony 55
  • 56. Sympal - a CMS based on Symfony • Or YAML can be controlled via a web form • When configuration form is saved the YAML file is written Jonathan H. Wage: Sympal a CMS Based on Symfony 56
  • 57. Sympal - a CMS based on Symfony • Since the configuration uses the symfony app.yml it can be controlled at different levels of symfony – Project – Application – Module Jonathan H. Wage: Sympal a CMS Based on Symfony 57
  • 58. Sympal - a CMS based on Symfony • Other items related to content records can be configured at different levels. For example the layout can be controlled – Globally – Per site – Per content type – Per content record • This means you can customize the layout an individual content record uses. Jonathan H. Wage: Sympal a CMS Based on Symfony 58
  • 59. Sympal - a CMS based on Symfony Security Jonathan H. Wage: Sympal a CMS Based on Symfony 59
  • 60. Sympal - a CMS based on Symfony • sfSympalUserPlugin is forked version of sfDoctrineGuardPlugin – Users – Groups – Permissions – Forgot Password – Registration • Menus, content records, etc. can all be locked down with permissions. Jonathan H. Wage: Sympal a CMS Based on Symfony 60
  • 61. Sympal - a CMS based on Symfony List users Jonathan H. Wage: Sympal a CMS Based on Symfony 61
  • 62. Sympal - a CMS based on Symfony Edit users Jonathan H. Wage: Sympal a CMS Based on Symfony 62
  • 63. Sympal - a CMS based on Symfony List groups Jonathan H. Wage: Sympal a CMS Based on Symfony 63
  • 64. Sympal - a CMS based on Symfony Edit group Jonathan H. Wage: Sympal a CMS Based on Symfony 64
  • 65. Sympal - a CMS based on Symfony List permissions Jonathan H. Wage: Sympal a CMS Based on Symfony 65
  • 66. Sympal - a CMS based on Symfony Edit permission Jonathan H. Wage: Sympal a CMS Based on Symfony 66
  • 67. Sympal - a CMS based on Symfony Sympal Admin Generator Theme Jonathan H. Wage: Sympal a CMS Based on Symfony 67
  • 68. Sympal - a CMS based on Symfony • Sympal comes with custom admin generator them • Tabbed forms for fieldsets and embedded forms Jonathan H. Wage: Sympal a CMS Based on Symfony 68
  • 69. Sympal - a CMS based on Symfony Easily click Filters to popup the filters form Jonathan H. Wage: Sympal a CMS Based on Symfony 69
  • 70. Sympal - a CMS based on Symfony Floating Editor Panel Jonathan H. Wage: Sympal a CMS Based on Symfony 70
  • 71. Sympal - a CMS based on Symfony When logged in as editor and viewing a content record a floating editor panel is displayed Jonathan H. Wage: Sympal a CMS Based on Symfony 71
  • 72. Sympal - a CMS based on Symfony Content Slot Types Jonathan H. Wage: Sympal a CMS Based on Symfony 72
  • 73. Sympal - a CMS based on Symfony • A content slot in Sympal is an arbitrary piece of content and has a type. • Sympal comes bundled with a few content slot types Jonathan H. Wage: Sympal a CMS Based on Symfony 73
  • 74. Sympal - a CMS based on Symfony • The default slot types offered by Sympal are – Markdown – MultiLineText – RichText – Text • Add your own custom slot types for your projects Jonathan H. Wage: Sympal a CMS Based on Symfony 74
  • 75. Sympal - a CMS based on Symfony YUI Rich Text Editor Jonathan H. Wage: Sympal a CMS Based on Symfony 75
  • 76. Sympal - a CMS based on Symfony The RichText slot type uses the YUI rich text editor Jonathan H. Wage: Sympal a CMS Based on Symfony 76
  • 77. Sympal - a CMS based on Symfony The YUI rich text editor also implements the ability to upload and embed images inline Jonathan H. Wage: Sympal a CMS Based on Symfony 77
  • 78. Sympal - a CMS based on Symfony Sending E-Mails Jonathan H. Wage: Sympal a CMS Based on Symfony 78
  • 79. Sympal - a CMS based on Symfony • A reoccurring need • Re-implementing the functionality over and over wasting time • We need a standard way to send and manage our e-mail templates • Sympal offers a solution Jonathan H. Wage: Sympal a CMS Based on Symfony 79
  • 80. Sympal - a CMS based on Symfony In your actions you can easily create new e-mails and send them class my_moduleActions extends sfActions { public function executeSome_action(sfWebRequest $request) { $variables = array( 'name' => 'Jonathan H. Wage' ); $email = $this->newEmail('email_module/test', $variables); $email->send('jonwage@gmail.com'); } } Jonathan H. Wage: Sympal a CMS Based on Symfony 80
  • 81. Sympal - a CMS based on Symfony • The templates used for a Sympal e- mail are just a partial or component • In the previous example we use a partial named _test.php Hello <?php echo $name ?>, This is a test e-mail that we are sending to <?php echo $name ?> Jonathan H. Wage: Sympal a CMS Based on Symfony 81
  • 82. Sympal - a CMS based on Symfony • The first line of the template is the subject • The second line and after is the body of the e-mail • This way the contents of the e- mail(subject and body) are managed in one place Jonathan H. Wage: Sympal a CMS Based on Symfony 82
  • 83. Sympal - a CMS based on Symfony • The newEmail() method returns an instance of sfSympalMail • sfSympalMail is a wrapper around your mail sending program which defaults to Swift in Sympal Jonathan H. Wage: Sympal a CMS Based on Symfony 83
  • 84. Sympal - a CMS based on Symfony Multiple Sites Jonathan H. Wage: Sympal a CMS Based on Symfony 84
  • 85. Sympal - a CMS based on Symfony • Sympal can handle multiple sites • A sympal site is directly bound to a symfony application • This is how Sympal knows which site you are in and can limit the data to only that site Jonathan H. Wage: Sympal a CMS Based on Symfony 85
  • 86. Sympal - a CMS based on Symfony Jonathan H. Wage: Sympal a CMS Based on Symfony 86
  • 87. Sympal - a CMS based on Symfony Search Engine Optimization Jonathan H. Wage: Sympal a CMS Based on Symfony 87
  • 88. Sympal - a CMS based on Symfony • SEO capabilities are built in • You can specify global title, keywords and description for your project. • They can also be overridden by each site or even by individual content records Jonathan H. Wage: Sympal a CMS Based on Symfony 88
  • 89. Sympal - a CMS based on Symfony • sfSympalAutoSEOPlugin – Who is going to write it? :) – Automatically generate SEO for content records from the final rendered HTML • Parse the first <h1> tag value for the meta title • Build a list of top words used in the content record for the meta keywords • Parse the first <p> tag value for the meta description – Write good content and you’ll have SEO Jonathan H. Wage: Sympal a CMS Based on Symfony 89
  • 90. Sympal - a CMS based on Symfony Dashboard Jonathan H. Wage: Sympal a CMS Based on Symfony 90
  • 91. Sympal - a CMS based on Symfony When a user logs in and has some credentials he’ll be forwarded to his dashboard. A super administrator would see everything. Something like the below... Jonathan H. Wage: Sympal a CMS Based on Symfony 91
  • 92. Sympal - a CMS based on Symfony • Dashboard is generated using the sfSympalMenu classes • The menu instance used to generate the dashboard is passed through an event so you can easily add to it by connecting to an event Jonathan H. Wage: Sympal a CMS Based on Symfony 92
  • 93. Sympal - a CMS based on Symfony Connect to dashboard event and add to the menu object class sfSympalTestPluginConfiguration extends sfPluginConfiguration { public function initialize() { $this->dispatcher->connect('sympal.load_dashboard_boxes', array($this, 'loadDashboardBoxes') ); } public function loadDashboardBoxes(sfEvent $event) { $menu = $event['menu']; $menu->addChild('My New Box', '@route_name'); } } Jonathan H. Wage: Sympal a CMS Based on Symfony 93
  • 94. Sympal - a CMS based on Symfony Multiple Themes Jonathan H. Wage: Sympal a CMS Based on Symfony 94
  • 95. Sympal - a CMS based on Symfony • Sympal offers the ability to have themes and you can configure in multiple places what them to use – Globally – Per site – Per content type – Or per content record Jonathan H. Wage: Sympal a CMS Based on Symfony 95
  • 96. Sympal - a CMS based on Symfony • We can now easily have Sympal theme plugins that you can download and instantly have a new theme to change to • We already have three themes available that you can download and use – sfSympalPlugin - The default theme included with Sympal – sfSympalJwageThemePlugin - The theme used on my personal website, jwage.com – sfSympalDoctrineThemePlugin - The theme which powers the Doctrine website Jonathan H. Wage: Sympal a CMS Based on Symfony 96
  • 97. Sympal - a CMS based on Symfony Doctrine Theme Sympal Theme Jonathan H. Wage: Sympal a CMS Based on Symfony 97
  • 98. Sympal - a CMS based on Symfony Sympal CLI Tasks Jonathan H. Wage: Sympal a CMS Based on Symfony 98
  • 99. Sympal - a CMS based on Symfony Sympal comes with some other pretty useful tasks for improving your productivity when working in Symfony Jonathan H. Wage: Sympal a CMS Based on Symfony 99
  • 100. Sympal - a CMS based on Symfony • Most notable CLI tasks – sympal:delete-model - Delete a model from your project. Finds and deletes model, form and filter files all in one command – sympal:report-statistics - This task will report back to the Symfony Plugins API what all plugins you’re using in your project and will add them to your stack. – sympal:event-list - Report a list of events that are available for a URL in your application • See who has connected to an event Jonathan H. Wage: Sympal a CMS Based on Symfony 100
  • 101. Sympal - a CMS based on Symfony Show a list of all available events for a URL Jonathan H. Wage: Sympal a CMS Based on Symfony 101
  • 102. Sympal - a CMS based on Symfony Show only the events which have been connected to Jonathan H. Wage: Sympal a CMS Based on Symfony 102
  • 103. Sympal - a CMS based on Symfony Inspect an individual event to see who has connected to it and more importantly where! Jonathan H. Wage: Sympal a CMS Based on Symfony 103
  • 104. Sympal - a CMS based on Symfony More on Sympal Events Jonathan H. Wage: Sympal a CMS Based on Symfony 104
  • 105. Sympal - a CMS based on Symfony • Some might say I have overused the Symfony events system in Sympal • But, I really like it and I find it very useful in the CMS context. It allows for things to be very flexible and “changeable” by use of events. Jonathan H. Wage: Sympal a CMS Based on Symfony 105
  • 106. Sympal - a CMS based on Symfony • A re-occurring question – How can I add to a model of another plugin, or a model in my project from a plugin. – Before Sympal this was not possible but now if you models simply actAs sfSympalRecord or sfSympalContentType you can connect to an event which is notified during the setup of a Doctrine model Jonathan H. Wage: Sympal a CMS Based on Symfony 106
  • 107. Sympal - a CMS based on Symfony • Add a new column to the Sympal User model • The schema for the model looks like this User: tableName: users actAs: [Timestampable, sfSympalRecord] columns: first_name: string(255) last_name: string(255) # ... Jonathan H. Wage: Sympal a CMS Based on Symfony 107
  • 108. Sympal - a CMS based on Symfony • The actAs: [sfSympalRecord] allows us to connect to two events – sympal.user.set_table_definition – sympal.user.set_up • The set table definition allows us to add new columns, indexes, etc. • The set up allows us to add relationships, add behaviors, etc. Jonathan H. Wage: Sympal a CMS Based on Symfony 108
  • 109. Sympal - a CMS based on Symfony Now lets connect to the set table definition event and add a new column class sfSympalTestPluginConfiguration extends sfPluginConfiguration { public function initialize() { $this->dispatcher->connect('sympal.user.set_table_definition', array($this, 'setUserTableDefinition') ); } public function setUserTableDefinition(sfEvent $event) { $model = $event->getSubject(); $model->hasColumn('my_new_column', 'string', 255); } } Jonathan H. Wage: Sympal a CMS Based on Symfony 109
  • 110. Sympal - a CMS based on Symfony • We have a lot more events and I can’t talk about them all • But I will try and list some of the other notable events – sympal.user.pre_signin – sympal.user.post_signin – sympal.load_breadcrumbs – sympal.<model_name>.method_not_found – sympal.post_render_page_content – sympal.load_tools Jonathan H. Wage: Sympal a CMS Based on Symfony 110
  • 111. Sympal - a CMS based on Symfony With the Symfony events and the PHP __call() magic function we can fake “extending” a class by invoking a method_not_found event and letting users connect to it class sfSympalTestPluginConfiguration extends sfPluginConfiguration { public function initialize() { $this->dispatcher->connect('sympal.user.method_not_found', array(new myUserExtension(), 'extend') ); } } Jonathan H. Wage: Sympal a CMS Based on Symfony 111
  • 112. Sympal - a CMS based on Symfony Now lets define the myUserExtension class and add some new functionality class myUserExtension extends sfSympalExtendClass { public function getFullName() { return trim($this->getFirstName().' '.$this->getLastName()); } } Jonathan H. Wage: Sympal a CMS Based on Symfony 112
  • 113. Sympal - a CMS based on Symfony Now when I work with a User model instance I will be able to access my getFullName() method $user = new User(); $user->first_name = 'Jonathan'; $user->last_name = 'Wage'; echo $user->getFullName(); // Jonathan Wage Jonathan H. Wage: Sympal a CMS Based on Symfony 113
  • 114. Sympal - a CMS based on Symfony What is next? Jonathan H. Wage: Sympal a CMS Based on Symfony 114
  • 115. Sympal - a CMS based on Symfony • Continued development of Sympal • Work towards a 1.0 release • Spread the word and try and get as much feedback as possible Jonathan H. Wage: Sympal a CMS Based on Symfony 115
  • 116. Sympal - a CMS based on Symfony What do we need? Jonathan H. Wage: Sympal a CMS Based on Symfony 116
  • 117. Sympal - a CMS based on Symfony • Users, testers, feedback, etc. • Development help, documentation help • For development, we need the most help with the frontend Jonathan H. Wage: Sympal a CMS Based on Symfony 117
  • 118. Sympal - a CMS based on Symfony • Frontend development – YUI/JS/CSS guru – Usability guru • Backend development – Familiarity with Symfony and Doctrine obviously – Familiarity with other popular CMS in any other languages to help with functionality and implementation Jonathan H. Wage: Sympal a CMS Based on Symfony 118
  • 119. Sympal - a CMS based on Symfony Questions? Jonathan H. Wage jonathan.wage@sensio.com +1 415 992 5468 sensiolabs.com | doctrine-project.org | sympalphp.org | jwage.com You can contact Jonathan about Doctrine and Open-Source or for training, consulting, application development, or business related questions at jonathan.wage@sensio.com Jonathan H. Wage: Sympal a CMS Based on Symfony 119