public function testInjectTag() { TagParser::inject('foo', ['class' => LinkTag::class]); $tags = TagParser::getInstantiatedTagObjects(); $this->arrayHasKey('foo', $tags); $this->assertInstanceOf('luya\\tag\\tags\\LinkTag', $tags['foo']); }
/** * Before bootstrap run process. * * @see \luya\base\BaseBootstrap::beforeRun() */ public function beforeRun($app) { foreach ($app->tags as $name => $config) { TagParser::inject($name, $config); } foreach ($this->getModules() as $id => $module) { foreach ($module->urlRules as $rule) { $this->_urlRules[isset($rule['position']) ? $rule['position'] : UrlRule::POSITION_AFTER_LUYA][] = $rule; } foreach ($module->apis as $alias => $class) { $this->_apis[$alias] = $class; } foreach ($module->tags as $name => $config) { TagParser::inject($name, $config); } } }