{"id":25169637,"url":"https://github.com/timonf/twigony-bundle","last_synced_at":"2025-05-05T16:46:08.888Z","repository":{"id":57069945,"uuid":"87629354","full_name":"timonf/twigony-bundle","owner":"timonf","description":"Extends the idea of Symfony's TemplateController","archived":false,"fork":false,"pushed_at":"2017-11-10T10:40:16.000Z","size":38,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-30T22:32:13.960Z","etag":null,"topics":["php","php7","prototyping","symfony","symfony-bundle","twig"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timonf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-08T11:34:17.000Z","updated_at":"2022-02-12T14:31:23.000Z","dependencies_parsed_at":"2022-08-24T10:40:56.740Z","dependency_job_id":null,"html_url":"https://github.com/timonf/twigony-bundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonf%2Ftwigony-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonf%2Ftwigony-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonf%2Ftwigony-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonf%2Ftwigony-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timonf","download_url":"https://codeload.github.com/timonf/twigony-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252535729,"owners_count":21764001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php7","prototyping","symfony","symfony-bundle","twig"],"created_at":"2025-02-09T08:26:15.292Z","updated_at":"2025-05-05T16:46:08.863Z","avatar_url":"https://github.com/timonf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"{{ Twigony FrameworkBundle }}\n=============================\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/a20684cb-83aa-486f-8bec-e0a4cd3ae307/mini.png)](https://insight.sensiolabs.com/projects/a20684cb-83aa-486f-8bec-e0a4cd3ae307)\n\nTwigony is inspired by Symfony's [TemplateController](http://symfony.com/doc/3.3/templating/render_without_controller.html).\nTwigony provides default controller actions for common use cases. You are able to configure Twigony through your\n`routing.yml` file (like Symfony's TemplateController).\n\nGoals of Twigony:\n\n * Easy to use (no own controllers are needed, an Entity and a template is all you need)\n * Usable for fast prototyping\n * Usable for simple pages\n * Much more frontend code (Twig) and less backend code (PHP/Symfony)\n * Covers common use cases (database listing, email…)\n\n---------------------------------------\n\n**Information:** This project is in development. If you want to support me\nor this project contact me on [Slack](https://symfony-devs.slack.com) (My name: @timon).\nIf you don't have access to Slack, have a look [here](http://symfony.com/support).\n\n---------------------------------------\n\nInstallation\n------------\n\nCreate an empty project and use composer to install this bundle:\n\n```console\n$ symfony new your-new-project\n$ composer require timonf/twigony-framework-bundle\n```\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new \\Twigony\\Bundle\\FrameworkBundle\\TwigonyFrameworkBundle(),\n        );\n    }\n}\n```\n\nDocumentation\n-------------\n\n * [TemplateController](Resources/doc/TemplateController.md) for static pages (`_controller: twigony.template_controller:templateAction`)\n * [SecurityController](Resources/doc/SecurityController.md) for login page (`_controller: twigony.security_controller:loginAction`)\n * [SwiftMailerController](Resources/doc/SwiftMailerController.md) for email forms (`_controller: twigony.mailer_controller:emailAction`)\n * [DoctrineORMController](Resources/doc/DoctrineORMController.md) for database operations (`_controller: twigony.template_controller:*`)\n\n\nExample usages\n--------------\n\n### Multiple static pages (TemplateController)\n\n1.  Create two or more Twig templates (like `app/views/info/hello.html.twig` and `app/views/info/about.html.twig`)\n2.  Extend your `routing.yml`:\n        \n        info_pages:\n            path: '/info/{page}'\n            defaults:\n                _controller: 'twigony.template_controller:templateAction'\n                template:    'info/{page}.html.twig'\n\n\n### List entities (DoctrineORMController)\n\n1.  [Create an entity](http://symfony.com/doc/3.3/doctrine.html#creating-an-entity-class)\n    or use an existing one (e .g. `src/AppBundle/Entity/Post.php`)\n2.  Create a template (like `app/views/posts/all.html.twig`)\n3.  Extend your `routing.yml`:\n\n        posts:\n            path: '/posts'\n            defaults:\n                _controller: 'twigony.orm_controller:listAction'\n                template: 'posts/all.html.twig'\n                entity: 'AppBundle\\Entity\\Post'\n                options:\n                    as: 'posts' # Access variable for your Twig template. You can use it this way `{% for post in posts %}…`\n                    perPage: 50\n\n### Show single entity (DoctrineORMController)\n\n1.  [Create an entity](http://symfony.com/doc/3.3/doctrine.html#creating-an-entity-class)\n    or use an existing one (e .g. `src/AppBundle/Entity/Post.php`)\n2.  Create a template (like `app/views/posts/show.html.twig`)\n3.  Extend your `routing.yml`:\n\n        show_post:\n            path: '/posts/{id}' # Make sure, you are using \"id\" as id parameter!\n            defaults:\n                _controller: 'twigony.orm_controller:viewAction'\n                template: 'posts/show.html.twig'\n                entity:   'AppBundle\\Entity\\Post'\n                options:\n                    as: 'post' # Access variable for your Twig template. You can use it this way `{{ post.title }}…`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonf%2Ftwigony-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimonf%2Ftwigony-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonf%2Ftwigony-bundle/lists"}