Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fboes/twig-broiler
Basic setup to get you started with Twig
https://github.com/fboes/twig-broiler
Last synced: about 1 month ago
JSON representation
Basic setup to get you started with Twig
- Host: GitHub
- URL: https://github.com/fboes/twig-broiler
- Owner: fboes
- License: mit
- Created: 2014-04-25T07:12:46.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-03-13T06:33:47.000Z (almost 4 years ago)
- Last Synced: 2024-04-09T15:02:59.392Z (9 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
The Twig-Broiler
============Basic setup to get you started with Twig. For setting up:
1. Copy templates to your template directory
2. Modify `base_project.html.twig` to match your general project template
3. You may want to alter all project specific variables (starting with `{{ app.`) to match your project variables
4. Add more templates for special viewsFor more information see [Twig Documentation](http://twig.sensiolabs.org/). Twig is used by [Symfony2](http://symfony.com/doc/current/book/templating.html), [Silex](http://silex.sensiolabs.org/doc/providers/twig.html) and [Drupal 8+](http://anthonyringoet.be/post/introduction-to-twig/).
Installation in Symfony
-----1. Copy files from `/TwigBroiler/Ressources/views` to `/app/Ressources/views/`
2. Create new bundle in `/src/TwigBroilerBundle` via `php app/console generate:bundle`
3. Copy all files to `/src/TwigBroilerBundle`
4. Create `/src/TwigFiltersBundle/Ressources/config/services.yml`Installation in Silex
-----1. Copy files from `/TwigBroiler/Ressources/views` to `/app/views/`
2. Copy files from `/TwigBroiler` to `/src/TwigBroiler`
3. Copy these lines to `/app/app.php````
$loader->add('TwigBroiler', realpath(__DIR__.'/../src'));$app['asset_path'] = '';
$app['locale'] = 'de';
$app['config']['frontend'] = array(
'title' => '…',
'description' => '…',
);$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/views',
));
$app['twig']->addExtension(new \TwigBroiler\Twig\CsvExtension());
$app['twig']->addExtension(new \TwigBroiler\Twig\HelperExtension());
$app['twig']->addExtension(new \TwigBroiler\Twig\HtmlExtension());
$app['twig']->addExtension(new \TwigBroiler\Twig\JsExtension());
$app['twig']->addExtension(new \TwigBroiler\Twig\SocialMediaExtension());$app->before(function () use ($app) {
$app['twig']->addGlobal('base', $app['twig']->loadTemplate('base.html.twig'));
$app['twig']->addGlobal('base_project', $app['twig']->loadTemplate('base_project.html.twig'));
});
```Version
-------Version: 0.9 (2014-07-25)
Legal stuff
-----------Author: [Frank Boës](http://3960.org)
Copyright & license: See LICENSE.txt