Download the PHP package timonf/twigony-framework-bundle without Composer
On this page you can find all versions of the php package timonf/twigony-framework-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package twigony-framework-bundle
{{ Twigony FrameworkBundle }}
Twigony is inspired by Symfony's TemplateController.
Twigony provides default controller actions for common use cases. You are able to configure Twigony through your
routing.yml
file (like Symfony's TemplateController).
Goals of Twigony:
- Easy to use (no own controllers are needed, an Entity and a template is all you need)
- Usable for fast prototyping
- Usable for simple pages
- Much more frontend code (Twig) and less backend code (PHP/Symfony)
- Covers common use cases (database listing, email…)
Information: This project is in development. If you want to support me or this project contact me on Slack (My name: @timon). If you don't have access to Slack, have a look here.
Installation
Create an empty project and use composer to install this bundle:
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
Documentation
- TemplateController for static pages (
_controller: twigony.template_controller:templateAction
) - SecurityController for login page (
_controller: twigony.security_controller:loginAction
) - SwiftMailerController for email forms (
_controller: twigony.mailer_controller:emailAction
) - DoctrineORMController for database operations (
_controller: twigony.template_controller:*
)
Example usages
Multiple static pages (TemplateController)
- Create two or more Twig templates (like
app/views/info/hello.html.twig
andapp/views/info/about.html.twig
) -
Extend your
routing.yml
:info_pages: path: '/info/{page}' defaults: _controller: 'twigony.template_controller:templateAction' template: 'info/{page}.html.twig'
List entities (DoctrineORMController)
- Create an entity
or use an existing one (e .g.
src/AppBundle/Entity/Post.php
) - Create a template (like
app/views/posts/all.html.twig
) -
Extend your
routing.yml
:posts: path: '/posts' defaults: _controller: 'twigony.orm_controller:listAction' template: 'posts/all.html.twig' entity: 'AppBundle\Entity\Post' options: as: 'posts' # Access variable for your Twig template. You can use it this way `{% for post in posts %}…` perPage: 50
Show single entity (DoctrineORMController)
- Create an entity
or use an existing one (e .g.
src/AppBundle/Entity/Post.php
) - Create a template (like
app/views/posts/show.html.twig
) -
Extend your
routing.yml
:show_post: path: '/posts/{id}' # Make sure, you are using "id" as id parameter! defaults: _controller: 'twigony.orm_controller:viewAction' template: 'posts/show.html.twig' entity: 'AppBundle\Entity\Post' options: as: 'post' # Access variable for your Twig template. You can use it this way `{{ post.title }}…`
All versions of twigony-framework-bundle with dependencies
doctrine/orm Version ^2.5
swiftmailer/swiftmailer Version ^5.4
symfony/form Version ~2.8|~3.0|~4.0
symfony/framework-bundle Version ~2.8|~3.0|~4.0
symfony/http-foundation Version ~2.8|~3.0|~4.0
symfony/http-kernel Version ~2.8|~3.0|~4.0
symfony/property-access Version ~2.8|~3.0|~4.0
symfony/security Version ~2.8|~3.0|~4.0
symfony/templating Version ~2.8|~3.0|~4.0
twig/twig Version ~1.26|~2.0