zephyr / editable-bundle
Zephyr EditableBundle
Installs: 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.9
- symfony/form: ~2.3|~3.0
- symfony/framework-bundle: ~2.3|~3.0
- symfony/security-bundle: ~2.3|~3.0
- symfony/twig-bundle: ~2.3|~3.0
Requires (Dev)
- doctrine/doctrine-bundle: ~1.3
- phpunit/phpunit: ~4.0
- squizlabs/php_codesniffer: ~1.5
- swiftmailer/swiftmailer: ~4.3|~5
- symfony/console: ~2.3|~3.0
- symfony/phpunit-bridge: ~2.7|~3.0
- symfony/validator: ~2.3|~3.0
- symfony/yaml: ~2.3|~3.0
Suggests
- willdurand/propel-typehintable-behavior: Needed when using the propel implementation
This package is auto-updated.
Last update: 2024-11-12 07:21:42 UTC
README
Add the vendor
composer require zephyr/editable-bundle
Add in AppKernel
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), // ... ]; // ... } // ... }
Use Cases
Custom formtype for administration
Use the formtype. Save process is included in the submit action.
<?php //... $builder ->add('a_virtual_field', EditableType::class_name, ['reference'=>'nom_reference', 'page'=>'nom_page'] //...
ESI render for front
{{ render_esi(controller('ZephyrEditableBundle:Content:show', {'reference'=>'nom_reference', 'page'=>'page'})) }}
Media management
Add dependants bundles
vichuploader
Administration
Administration pages are availables :
- /content: content edition
- /media: media edition
Installation
Add dependants bundles
jsrouting sgdatatables
Add routes
Routes are prefixables and importables :
zephyr_editable: resource: "@ZephyrEditableBundle/Resources/config/routing.yml" prefix: /admin/editable
Override the layout
Create a file in :
app/Resources/ZephyrUserBundle/views/layout.html.twig
Security
-
Authorize edition with access control
-
Implements your own voter :
The attribute is 'EDITABLE' on the modified object Documentation: https://symfony.com/doc/current/cookbook/security/voters.html