{"id":28400661,"url":"https://github.com/beyerz/simplehmvcbundle","last_synced_at":"2026-05-01T06:32:31.209Z","repository":{"id":62493715,"uuid":"57153251","full_name":"beyerz/SimpleHMVCBundle","owner":"beyerz","description":"Simple HMVC Bundle for Symfony","archived":false,"fork":false,"pushed_at":"2019-04-14T16:20:02.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T18:40:27.477Z","etag":null,"topics":["hmvc","hmvc-bundle","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"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/beyerz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-26T18:43:54.000Z","updated_at":"2019-09-27T10:37:21.000Z","dependencies_parsed_at":"2022-11-02T11:18:02.012Z","dependency_job_id":null,"html_url":"https://github.com/beyerz/SimpleHMVCBundle","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/beyerz/SimpleHMVCBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyerz%2FSimpleHMVCBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyerz%2FSimpleHMVCBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyerz%2FSimpleHMVCBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyerz%2FSimpleHMVCBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyerz","download_url":"https://codeload.github.com/beyerz/SimpleHMVCBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyerz%2FSimpleHMVCBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262421734,"owners_count":23308500,"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":["hmvc","hmvc-bundle","symfony","symfony-bundle"],"created_at":"2025-06-01T11:07:15.239Z","updated_at":"2026-05-01T06:32:31.166Z","avatar_url":"https://github.com/beyerz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleHMVCBundle\nSimple HMVC Bundle for Symfony2\n\nThe HMVC design pattern, came about when trying resolve the problem of embedding widgets into pages.\nHMVC allows us to cleanly separate Controller, Model and View logic's, enabling us to create easier to work with and clearly encompassed code.\n\nSymfony2 does provide us with tools that allow us to \"load\" routes within our controllers and our views, but the process, behind the scenes,\nis more complex than I like.\n\nFor info on embedding using the symfony provided options see:\nhttp://symfony.com/doc/2.8/book/templating.html#templating-embedding-controller\n\nHMVC (Hierarchical model-view-controller) symfony bundle enables you to \"Widgetize\" or as used in this bundle \"Elementize\" your controllers.\nArchitecturally this allows you to recursively include the same element one or many times across multiple pages without having to rebuild or restate the model logic.\n\n# Installation\n\n### Composer (Recommended)\n\n    composer require beyerz/simple-hmvc-bundle\n\n### Application Kernel\n\nAdd SimpleHMVC to the `registerBundles()` method of your application kernel:\n\n```php\npublic function registerBundles()\n{\n    return array(\n        new Beyerz\\SimpleHMVCBundle\\BeyerzSimpleHMVCBundle(),\n    );\n}\n```\n\n# Usage\n\nPages and Elements can be created by hand or generated using the provided commands.\nIf you choose to create them manually or need to update manually, please consider the expected file structure\n\n### Creating Pages\nUsing the command\n```bash\nphp app/console hmvc:page\n```\nFor additional options or help\n```bash\nphp app/console hmvc:page --help\n```\nThis command will generate a controller with one or many actions according to your specification.\nFor every controller action the following classes will be created, {action}Model, {action}Context, {action}Input\nand a view in snake case format.\n\nThe creation of a page with results in the following directory structure\nThe Controller name used here is: BeyerzTestingBundle:GitExample\n\n```\n├── Context\n│   └── Page\n│       └── GitExample\n│           ├── FirstExampleContext.php\n│           └── SecondExampleContext.php\n├── Controller\n│   └── Page\n│       └── GitExampleController.php\n├── Input\n│   └── Page\n│       └── GitExample\n│           ├── FirstExampleInput.php\n│           └── SecondExampleInput.php\n├── Model\n│   └── Page\n│       └── GitExample\n│           ├── FirstExampleModel.php\n│           └── SecondExampleModel.php\n├── Resources\n│   ├── config\n│   │   ├── routing.yml\n│   │   └── services.yml\n│   └── views\n│       └── Page\n│           └── GitExample\n│               ├── first_example.html.twig\n│               └── second_example.html.twig\n└── Tests\n    └── Controller\n        └── Page\n            └── GitExampleControllerTest.php\n```\n\nYou can also create controllers under different directories by specifying the path during the creation.\nA simple sub-controller would generate this file structure\nThe Controller name used here is: BeyerzTestingBundle:GitExample/SubExample\n\n```\n├── Context\n│   └── Page\n│       └── GitExample\n│           └── SubExample\n│               ├── FirstSubExampleContext.php\n│               └── SecondSubExampleContext.php\n├── Controller\n│   └── Page\n│       └── GitExample\n│           └── SubExampleController.php\n├── Input\n│   └── Page\n│       └── GitExample\n│           └── SubExample\n│               ├── FirstSubExampleInput.php\n│               └── SecondSubExampleInput.php\n├── Model\n│   └── Page\n│       └── GitExample\n│           └── SubExample\n│               ├── FirstSubExampleModel.php\n│               └── SecondSubExampleModel.php\n├── Resources\n│   ├── config\n│   │   ├── routing.yml\n│   │   └── services.yml\n│   └── views\n│       └── Page\n│           └── GitExample\n│               └── SubExample\n│                   ├── first_sub_example.html.twig\n│                   └── second_sub_example.html.twig\n└── Tests\n    └── Controller\n        └── Page\n            └── GitExample\n                └── SubExampleControllerTest.php\n```\n### Creating Elements\n\nElements are very similar to pages, except that no controller is generated for elements.\n\nUsing the command\n```bash\nphp app/console hmvc:element\n```\nFor additional options or help\n```bash\nphp app/console hmvc:element --help\n```\nThis command will generate the following classes, {element}Model, {element}Context, {element}Input\nand a view in snake case format.\n\nThe creation of an element results in the following directory structure\nThe Element name used here is: BeyerzTestingBundle:GitElement\n\n```\n├── Context\n│   └── Element\n│       └── GitElementContext.php\n├── Controller\n├── DependencyInjection\n│   ├── BeyerzTestingExtension.php\n│   └── Configuration.php\n├── Input\n│   └── Element\n│       └── GitElementInput.php\n├── Model\n│   └── Element\n│       └── GitElementModel.php\n├── Resources\n│   ├── config\n│   │   ├── routing.yml\n│   │   └── services.yml\n│   └── views\n│       └── Element\n│           └── git_element.html.twig\n└── Tests\n```\n\nYou can also create elements under different directories by specifying the path during the creation.\nA simple sub-element would generate this file structure\nThe element name used here is: BeyerzTestingBundle:GitExample/SubElement\n\n```\n├── Context\n│   └── Element\n│       └── GitExample\n│           └── SubElementContext.php\n├── Controller\n├── DependencyInjection\n│   ├── BeyerzTestingExtension.php\n│   └── Configuration.php\n├── Input\n│   └── Element\n│       └── GitExample\n│           └── SubElementInput.php\n├── Model\n│   └── Element\n│       └── GitExample\n│           └── SubElementModel.php\n├── Resources\n│   ├── config\n│   │   ├── routing.yml\n│   │   └── services.yml\n│   └── views\n│       └── Element\n│           └── GitExample\n│               └── sub_element.html.twig\n└── Tests\n```\n## How it works\n\n## Some useful articles\n* http://www.javaworld.com/article/2076128/design-patterns/hmvc--the-layered-pattern-for-developing-strong-client-tiers.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyerz%2Fsimplehmvcbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyerz%2Fsimplehmvcbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyerz%2Fsimplehmvcbundle/lists"}