Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Compatibility bundle for running Midgard MVC components and applications in Symfony2

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Bundle
Octocat-spinner-32 Compat
Octocat-spinner-32 Controller
Octocat-spinner-32 DependencyInjection
Octocat-spinner-32 EventListener
Octocat-spinner-32 Resources
Octocat-spinner-32 Router
Octocat-spinner-32 Templating
Octocat-spinner-32 MidgardMvcCompatBundle.php
Octocat-spinner-32 README.md
README.md

Symfony2 Midgard MVC Compatibility Bundle

This bundle has been created to allow running Midgard MVC components and applications under Symfony2.

Note: this is still under heavy development.

Installation

Install this bundle by adding the following to the deps file and running php bin/vendors install:

[MvcCompatBundle]
    git=git://github.com/bergie/MidgardMvcCompatBundle.git
    target=Midgard/MvcCompatBundle

Then add the Midgard namespace to the app/autoload.php:

'Midgard' => __DIR__.'/../vendor'

And enable this bundle in your Kernel:

new Midgard\MvcCompatBundle\MidgardMvcCompatBundle()

Configuration

You need to tell the MvcCompat autoloader where your Midgard MVC components are installed.

Do this by editing your config.yml. If your components are installed in the midgardmvc directory under Symfony2 root, then:

midgard_mvc_compat:
    root: "%kernel.root_dir%/../midgardmvc"

You also need to register all components you want to use as Symfony2 Bundles in your Kernel:

new Midgard\MvcCompatBundle\Bundle\ComponentBundle('org_midgardproject_news')

Running components in your Symfony2 application

You can run individual components by adding them to your route configuration. For example:

_projectsite:
    resource: "org_midgardproject_projectsite"
    prefix: /midgard
    type: midgardmvc

If your components need a Midgard2 repository connection, ensure that you also have the MidgardConnectionBundle installed and configured.

Something went wrong with that request. Please try again.