Permalink
Browse files

indents

  • Loading branch information...
1 parent 5c94ba4 commit e968958d0d79d74805a989e2d94cb300b4739210 @mtymek committed Mar 17, 2012
Showing with 65 additions and 65 deletions.
  1. +65 −65 README.md
View
130 README.md
@@ -19,86 +19,86 @@ Installation
2. Add ZfTwig to your application.config.php file:
-```php
- <?php
- return array(
- 'modules' => array(
- 'ZfTwig',
- 'Application',
- ),
- 'module_listener_options' => array(
- 'config_cache_enabled' => false,
- 'cache_dir' => 'data/cache',
- 'module_paths' => array(
- './module',
- './vendor',
+ ```php
+ <?php
+ return array(
+ 'modules' => array(
+ 'ZfTwig',
+ 'Application',
),
- ),
- );
-```
+ 'module_listener_options' => array(
+ 'config_cache_enabled' => false,
+ 'cache_dir' => 'data/cache',
+ 'module_paths' => array(
+ './module',
+ './vendor',
+ ),
+ ),
+ );
+ ```
3. Configure TwigRenderingStrategy in Module.php:
-```php
- public function init(Manager $moduleManager)
- {
- $events = StaticEventManager::getInstance();
- $events->attach('bootstrap', 'bootstrap', array($this, 'initializeView'));
- }
+ ```php
+ public function init(Manager $moduleManager)
+ {
+ $events = StaticEventManager::getInstance();
+ $events->attach('bootstrap', 'bootstrap', array($this, 'initializeView'));
+ }
- public function initializeView($e)
- {
- $app = $e->getParam('application');
- $basePath = $app->getRequest()->getBasePath();
- $locator = $app->getLocator();
- $renderer = $locator->get('ZfTwig\TwigRenderer');
- $renderer->plugin('basePath')->setBasePath($basePath);
+ public function initializeView($e)
+ {
+ $app = $e->getParam('application');
+ $basePath = $app->getRequest()->getBasePath();
+ $locator = $app->getLocator();
+ $renderer = $locator->get('ZfTwig\TwigRenderer');
+ $renderer->plugin('basePath')->setBasePath($basePath);
- $view = $locator->get('Zend\View\View');
- $twigStrategy = $locator->get('ZfTwig\TwigRenderingStrategy');
- $view->events()->attach($twigStrategy, 100);
- }
-```
+ $view = $locator->get('Zend\View\View');
+ $twigStrategy = $locator->get('ZfTwig\TwigRenderingStrategy');
+ $view->events()->attach($twigStrategy, 100);
+ }
+ ```
4. Configure Dependency Injection Container:
-```php
- return array(
- 'di' => array(
- 'instance' => array(
+ ```php
+ return array(
+ 'di' => array(
+ 'instance' => array(
- // setup other stuff...
- // ...
+ // setup other stuff...
+ // ...
- // setup view script resolvers - very similar to configuration
- // from ZendSkeletonApplication
- 'Zend\View\Resolver\AggregateResolver' => array(
- 'injections' => array(
- 'Zend\View\Resolver\TemplateMapResolver',
- 'Zend\View\Resolver\TemplatePathStack',
+ // setup view script resolvers - very similar to configuration
+ // from ZendSkeletonApplication
+ 'Zend\View\Resolver\AggregateResolver' => array(
+ 'injections' => array(
+ 'Zend\View\Resolver\TemplateMapResolver',
+ 'Zend\View\Resolver\TemplatePathStack',
+ ),
),
- ),
- 'Zend\View\Resolver\TemplateMapResolver' => array(
- 'parameters' => array(
- 'map' => array(
- 'layout/layout' => __DIR__ . '/../view/layout/layout.twig',
+ 'Zend\View\Resolver\TemplateMapResolver' => array(
+ 'parameters' => array(
+ 'map' => array(
+ 'layout/layout' => __DIR__ . '/../view/layout/layout.twig',
+ ),
),
),
- ),
- 'Zend\View\Resolver\TemplatePathStack' => array(
- 'parameters' => array(
- 'paths' => array(
- 'application' => __DIR__ . '/../view',
+ 'Zend\View\Resolver\TemplatePathStack' => array(
+ 'parameters' => array(
+ 'paths' => array(
+ 'application' => __DIR__ . '/../view',
+ ),
+ 'defaultSuffix' => 'twig' // change default extension from .phtml to .twig
),
- 'defaultSuffix' => 'twig' // change default extension from .phtml to .twig
),
- ),
- // Tell TwigRenderer how it should locate .twig files
- 'ZfTwig\TwigRenderer' => array(
- 'parameters' => array(
- 'resolver' => 'Zend\View\Resolver\AggregateResolver',
+ // Tell TwigRenderer how it should locate .twig files
+ 'ZfTwig\TwigRenderer' => array(
+ 'parameters' => array(
+ 'resolver' => 'Zend\View\Resolver\AggregateResolver',
+ ),
),
),
- ),
- );
-```
+ );
+ ```

0 comments on commit e968958

Please sign in to comment.