Closed PhillippOhlandt closed 8 years ago
This is an extension bug.
The registerServices
function is for registering services, not using them as using them invokes them before the request cycle.
If you need to make a function/property call to service you can use $app->extend()
to push that to when the container is finally built.
i.e. it should be more like:
public function registerServices(Application $app)
{
$app['twig'] = $app->extend(
'twig',
function ($twig) ($app) {
$seo = new SEO($this->getContainer(), $this->getConfig(), $this->version);
$twig->addGlobal('seo', $seo);
$twig->addGlobal('seoconfig', $this->getConfig());
return $twig;
}
);
}
I know nothing! 🙄
When you install my
ohlandt/user-profiles
extension andbodenotter/seo
, then you don't get a database update notification for adding the new user table fields. The reason is that my User Schema class is never be called when the Seo extension is installed.When you look at the
SeoExtension
class at line83
, you will see the following function:When you remove the two
addGlobal()
function calls, my User Schema class will be called and everything works. @bobdenotter confirmed that this must be a Bolt issue.Details