Giter Club home page Giter Club logo

silex-twig-breadcrumb-extension's People

Contributors

mvanbaak avatar nymo avatar rusranx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

silex-twig-breadcrumb-extension's Issues

Some Ideas & Problems

Usage is wrong, should be:

$app['breadcrumbs']->addItem()

Make second parameter of addItem optional


Update Template to translate

{{ breadcrumb.linkName|trans }}

Get FatalErrorException

Hey,

I get the error:
FatalErrorException in BreadCrumbCollection.php line 71:
Error: Call to a member function generate() on null

My app.php looks like

<?php
use Silex\Application;
use Silex\Provider;

//
// Application setup
//
$app = new Application();
$app->register(new Provider\DoctrineServiceProvider());
$app->register(new Provider\SecurityServiceProvider());
$app->register(new Provider\RememberMeServiceProvider());
$app->register(new Provider\SessionServiceProvider());
$app->register(new Provider\ServiceControllerServiceProvider());
$app->register(new Provider\UrlGeneratorServiceProvider());
$app->register(new Provider\TwigServiceProvider());
$app->register(new \nymo\Silex\Provider\BreadCrumbServiceProvider());

$app['twig.path'] = array(__DIR__ . '/../templates');
//$app['twig.options'] = array('cache' => __DIR__ . '/../var/cache/twig');
$app['twig'] = $app->share(
  $app->extend(
    'twig',
    function ($twig, $app) {
      $twig->addExtension(new \nymo\Twig\Extension\BreadCrumbExtension($app));
      return $twig;
    }
  )
);


$app->register(new Provider\SwiftmailerServiceProvider());
// Register the SimpleUser service provider.
$simpleUserProvider = new SimpleUser\UserServiceProvider();
$app->register($simpleUserProvider);
//
// Controllers
//
$app->mount('/user', $simpleUserProvider);
$app->get('/', 'Piano\Controller\PagesController::indexAction')->bind('homepage');
$app->get('/ueber-uns', 'Piano\Controller\PagesController::aboutAction')->bind('about');


require __DIR__ . '/../config/local.php';
return $app;

renderBreadCrumbs already initialized

When I change a Template and reload it the first time, I get this:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Unable to register extension "renderBreadCrumbs" as extensions have already been initialized.") in "layout.html" at line 225.

After a reload it's okay and works. Sometimes this happens randomly

Make use of trans filter optional again

Currently you have add the TranslationServiceProvider in order to use the current extension or override the template and remove the trans filter.
We should make the trans filter optional again and remove the dependency to the TranslationServiceProvider.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.