ivoaz / content-editable-bundle
This bundle provides a twig extension for editable content with internationalization support.
Installs: 90
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 6
Type:symfony-bundle
Requires
- php: >=5.5
- symfony/config: ~2.8|~3.0
- symfony/dependency-injection: ~2.8|~3.0
- symfony/event-dispatcher: ~2.8|~3.0
- symfony/form: ~2.8|~3.0
- symfony/http-foundation: ~2.8|~3.0
- symfony/security: ~2.8|~3.0
- symfony/validator: ~2.8|~3.0
- twig/twig: ~1.23
Requires (Dev)
- doctrine/doctrine-bundle: ~1.6
- doctrine/mongodb-odm-bundle: ~3.0@dev
- doctrine/orm: ~2.3
- phpunit/phpunit: ~4.8|~5.0
This package is not auto-updated.
Last update: 2024-11-09 20:07:08 UTC
README
The IvoazContentEditableBundle
provides a twig extension for editable content
with internationalization support in Symfony framework.
Example usage:
<h1>{{ 'Go ahead, edit away!' | contenteditable }}</h1>
This saves the content of the current locale in the database and lets a user
with a ROLE_ADMIN
permission edit the content with the browser's
content editable
feature.
Here's another example with a larger content:
{% contenteditable "content_editable_description" %} <h2>HTMLElement.contentEditable</h2> <p>The <strong><code>HTMLElement.contentEditable</code></strong> property is used to indicate whether or not the element is editable.</p> {% contenteditable %}
Requirements
- PHP >=5.5
- Symfony ~2.8|~3.0
- Doctrine ORM ~2.4
- Twig ~1.23
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:
$ composer require ivoaz/content-editable-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Ivoaz\Bundle\ContentEditableBundle\IvoazContentEditableBundle(), ); // ... } // ... }
Step 3: Update the database schema
Contents are stored in the database, so you need to update the schema:
$ bin/console doctrine:schema:update --force
Step 4: Configure the routing
Now configure the routing with the prefix you want:
# app/config/routing.yml ivoaz_contente_ditable: resource: "@IvoazContentEditableBundle/Resources/config/routing.xml" prefix: admin/contenteditable
Step 5: Install the assets
Lastly, if you are not making your own editor, install the assets needed for the default editor:
$ bin/console assets:install --symlink
Documentation
For more detailed information about the features of this bundle, please refer to the documentation.
License
This bundle is released under the MIT license