symfony-bundle hmvc-bundle
Stupid simple HMVC service for Symfony 2
netgusto/hmvc-bundle
Stupid simple HMVC service for Symfony 2
- Sunday, June 1, 2014
- by netgusto
- Repository
- 1 Watchers
- 0 Stars
- 23 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Stupid simple HMVC service for Symfony 2
Install
In composer.json
:, (*1)
"require": {
"netgusto/hmvc-bundle": "dev-master"
}
In app/AppKernel.php
:, (*2)
$bundles = array(
# [...]
new Netgusto\HMVCBundle\NetgustoHMVCBundle(),
# [...]
);
Use
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Request;
class DefaultController extends Controller {
public function someAction(Request $request) {
$newsletterResponse = $this->get('netgusto.hmvc')->delegate('AcmeDemoBundle:SomeOtherController:subscribeNewsletter');
return $this->render('AcmeDemoBundle:Default:home.html.twig', array(
'newsletter' => $newsletterResponse->getContent(),
));
}
}