silexphp / Silex-Skeleton

A skeleton to get started with Silex
MIT License
780 stars 197 forks source link

Method "url_generator" for object "Symfony\Bridge\Twig\AppVariable" does not exist in... #52

Closed alexdruhet closed 9 years ago

alexdruhet commented 9 years ago

Hi, I run a composer update, now I can't get any services variables in my twig templates anymore (neither app.request_stack). I try to fix that since hours without any success. Does somebody have an idea or experience the same issue ?

Here is the update log :

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing symfony/dom-crawler (v2.6.7)
  - Installing symfony/dom-crawler (v2.7.3)
    Downloading: 100%         

  - Removing symfony/browser-kit (v2.6.7)
  - Installing symfony/browser-kit (v2.7.3)
    Downloading: 100%         

  - Removing symfony/class-loader (v2.6.7)
  - Installing symfony/class-loader (v2.7.3)
    Downloading: 100%         

  - Removing symfony/filesystem (v2.6.7)
  - Installing symfony/filesystem (v2.7.3)
    Downloading: 100%         

  - Removing symfony/config (v2.6.7)
  - Installing symfony/config (v2.7.3)
    Downloading: 100%         

  - Removing symfony/console (v2.6.7)
  - Installing symfony/console (v2.7.3)
    Loading from cache

  - Removing symfony/css-selector (v2.6.7)
  - Installing symfony/css-selector (v2.7.3)
    Downloading: 100%         

  - Removing symfony/debug (v2.6.7)
  - Installing symfony/debug (v2.7.3)
    Downloading: 100%         

  - Removing symfony/finder (v2.6.7)
  - Installing symfony/finder (v2.7.3)
    Downloading: 100%         

  - Removing symfony/property-access (v2.6.7)
  - Installing symfony/property-access (v2.7.3)
    Downloading: 100%         

  - Removing symfony/options-resolver (v2.6.7)
  - Installing symfony/options-resolver (v2.7.3)
    Downloading: 100%         

  - Removing symfony/intl (v2.6.7)
  - Installing symfony/intl (v2.7.3)
    Downloading: 100%         

  - Removing symfony/event-dispatcher (v2.6.7)
  - Installing symfony/event-dispatcher (v2.7.3)
    Downloading: 100%         

  - Removing symfony/form (v2.6.7)
  - Installing symfony/form (v2.7.3)
    Downloading: 100%         

  - Removing monolog/monolog (1.13.1)
  - Installing monolog/monolog (1.17.1)
    Downloading: 100%         

  - Removing symfony/monolog-bridge (v2.6.7)
  - Installing symfony/monolog-bridge (v2.7.3)
    Downloading: 100%         

  - Removing symfony/process (v2.6.7)
  - Installing symfony/process (v2.7.3)
    Downloading: 100%         

  - Removing symfony/http-foundation (v2.6.7)
  - Installing symfony/http-foundation (v2.7.3)
    Downloading: 100%         

  - Removing symfony/http-kernel (v2.6.7)
  - Installing symfony/http-kernel (v2.7.3)
    Downloading: 100%         

  - Removing symfony/security (v2.7.1)
  - Installing symfony/security (v2.7.3)
    Downloading: 100%         

  - Removing symfony/translation (v2.6.7)
  - Installing symfony/translation (v2.7.3)
    Downloading: 100%         

  - Removing symfony/validator (v2.6.7)
  - Installing symfony/validator (v2.7.3)
    Downloading: 100%         

  - Removing cocur/slugify (v1.1)
  - Installing cocur/slugify (v1.3)
    Downloading: 100%         

  - Removing twig/twig (v1.18.1)
  - Installing twig/twig (v1.21.1)
    Downloading: 100%         

  - Removing pimple/pimple (v3.0.0)
  - Installing pimple/pimple (v3.0.1)
    Downloading: 100%         

  - Removing symfony/stopwatch (v2.6.7)
  - Installing symfony/stopwatch (v2.7.3)
    Downloading: 100%         

  - Removing symfony/twig-bridge (v2.6.7)
  - Installing symfony/twig-bridge (v2.7.3)
    Downloading: 100%         

  - Removing symfony/routing (v2.6.7)
  - Installing symfony/routing (v2.7.3)
    Downloading: 100%         

  - Removing symfony/web-profiler-bundle (v2.6.7)
  - Installing symfony/web-profiler-bundle (v2.7.3)
    Downloading: 100%         

  - Updating silex/silex dev-master (bdbf5b7 => ff1fb3a)
    The package has modified files:
    M bin/build
    Discard changes [y,n,v,s,?]? 
    y - discard changes and apply the update
    n - abort the update and let you manually clean things up
    v - view modified files
    s - stash changes and try to reapply them after the update
    ? - print help
    Discard changes [y,n,v,s,?]? v
    M bin/build
    Discard changes [y,n,v,s,?]? y
    Checking out ff1fb3af45887e849d3d40f4df475536406d33af

  - Updating silex/web-profiler dev-master (bf7dec2 => babdbc0)
    Checking out babdbc0b5c8682178c09b5549ab9ef352a1843cd

Writing lock file
Generating autoload files
alexdruhet commented 9 years ago

This happen since $app is not anymore an instance of Silex\Application. It could be related to https://github.com/silexphp/Silex/pull/1231. The issue is not clearly solved, but my app is working again adding this line :

$twig->addGlobal('app', $app);
fabpot commented 9 years ago

Closing as this is a duplicate of the discussion on the main Silex repo: silexphp/Silex#1245