sfAlohaPlugin - 0.1.0

A plugin to edit content using Aloha Editor

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source

sfAlohaPlugin documentation


This plugin makes it very easy to turn any HTML element within a template into an editable WYSIWYG field using Aloha Editor. Aloha plugins are included to save the content (and upload pictures in a near future). The plugin can therefore be used to turn a symfony application into a very basic CMS.


  • Go to your symfony project's root directory

  • Install the plugin (via a package)

    ./symfony plugin:install sfAlohaPlugin
  • Install the plugin (via Git):

    git clone git@github.com:Justpassingby/sfAlohaPlugin.git plugins/sfAlohaPlugin
  • Activate the plugin in the config/ProjectConfiguration.class.php

    class ProjectConfiguration extends sfProjectConfiguration
      public function setup()
  • Rebuild your model

    ./symfony doctrine:build-model
    ./symfony doctrine:build-sql
  • Update you database tables (beware that it deletes all tables and create them from scratch):

    ./symfony doctrine:insert-sql
  • Publish plugin assets

    ./symfony plugin:publish-assets

Add editable content to a page

  • Execute ("My content" is an arbitrary name that will be used to easily identify content. It's like a title which won't be displayed)

    ./symfony aloha:create-content "My content"
  • In a template, render the content

    <?php use_helper('Aloha'); ?>
    <?php echo aloha_init_page(); ?>
    <?php echo aloha_render_element('My Content'); ?>
    • Now you can test your page, hover the mouse cursor on the div element, edit it, and click the save button in the Aloha editor toolbar :)