Twig\Error\RuntimeError {#934 -lineno: 8 -name: "@components/0-particles/icon/icon.twig" -rawMessage: "Variable "icon" does not exist." -sourcePath: "/Users/dennis/Projekte/e-fellows/src/components/0-particles/icon/icon.twig" -sourceCode: """ {% set title = title ?? false %}\n {% set description = description ?? false %}\n {% set isImage = title or description %}\n {% set id = isImage ? (id ??? html_id('icon')) -%}\n \n <svg {{ html_attributes({\n id: id,\n class: ['icon', 'icon--' ~ icon, class ?? ''],\n viewBox: viewBox ??? '0 0 200 200',\n role: isImage ? 'img',\n 'aria-hidden': not isImage ? 'true',\n 'aria-labelledby': isImage ? {\n (id ~ '-title'): title,\n (id ~ '-description'): description,\n },\n }, attrs ?? {}) }}>\n {%- if title -%}\n <title id="{{ id }}-title">{{ title }}</title>\n {%- endif -%}\n \n {%- if description -%}\n <desc id="{{ id }}-description">{{ description }}</desc>\n {%- endif -%}\n \n <use xlink:href="{{ asset('icons/icons.svg') }}#{{ icon }}"></use>\n </svg>\n \n {#- Prevent new line after icon -#}\n {{- '' -}}\n """ }
{% set isImage = title or description %}{% set id = isImage ? (id ??? html_id('icon')) -%}<svg {{ html_attributes({id: id,class: ['icon', 'icon--' ~ icon, class ?? ''],viewBox: viewBox ??? '0 0 200 200',role: isImage ? 'img','aria-hidden': not isImage ? 'true','aria-labelledby': isImage ? {(id ~ '-title'): title, $context["id"] = (((isset($context["isImage"]) || array_key_exists("isImage", $context) ? $context["isImage"] : (craft\helpers\Template::fallbackExists("isImage") ? craft\helpers\Template::fallback("isImage") : (function () { throw new RuntimeError('Variable "isImage" does not exist.', 4, $this->source); })()))) ? (((((array_key_exists("id", $context) || craft\helpers\Template::fallbackExists("id")) && !twig_test_empty((isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (craft\helpers\Template::fallbackExists("id") ? craft\helpers\Template::fallback("id") : (function () { throw new RuntimeError('Variable "id" does not exist.', 4, $this->source); })()))))) ? ((isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (craft\helpers\Template::fallbackExists("id") ? craft\helpers\Template::fallback("id") : (function () { throw new RuntimeError('Variable "id" does not exist.', 4, $this->source); })()))) : ($this->extensions['Gglnx\TwigHtmlExtendedExtra\Extension\HtmlExtendedExtension']->htmlId("icon")))) : ("")); // line 6 yield "<svg "; yield twig_html_extended_attributes($this->env, ["id" => // line 7(isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (craft\helpers\Template::fallbackExists("id") ? craft\helpers\Template::fallback("id") : (function () { throw new RuntimeError('Variable "id" does not exist.', 7, $this->source); })())), "class" => ["icon", ("icon--" . // line 8(isset($context["icon"]) || array_key_exists("icon", $context) ? $context["icon"] : (craft\helpers\Template::fallbackExists("icon") ? craft\helpers\Template::fallback("icon") : (function () { throw new RuntimeError('Variable "icon" does not exist.', 8, $this->source); })()))), (($context["class"]) ?? (""))], "viewBox" => ((( // line 9(array_key_exists("viewBox", $context) || craft\helpers\Template::fallbackExists("viewBox")) && !twig_test_empty((isset($context["viewBox"]) || array_key_exists("viewBox", $context) ? $context["viewBox"] : (craft\helpers\Template::fallbackExists("viewBox") ? craft\helpers\Template::fallback("viewBox") : (function () { throw new RuntimeError('Variable "viewBox" does not exist.', 9, $this->source); })()))))) ? ((isset($context["viewBox"]) || array_key_exists("viewBox", $context) ? $context["viewBox"] : (craft\helpers\Template::fallbackExists("viewBox") ? craft\helpers\Template::fallback("viewBox") : (function () { throw new RuntimeError('Variable "viewBox" does not exist.', 9, $this->source); })()))) : ("0 0 200 200")), "role" => (( // line 10(isset($context["isImage"]) || array_key_exists("isImage", $context) ? $context["isImage"] : (craft\helpers\Template::fallbackExists("isImage") ? craft\helpers\Template::fallback("isImage") : (function () { throw new RuntimeError('Variable "isImage" does not exist.', 10, $this->source); })()))) ? ("img") : ("")), "aria-hidden" => (( ! // line 11(isset($context["isImage"]) || array_key_exists("isImage", $context) ? $context["isImage"] : (craft\helpers\Template::fallbackExists("isImage") ? craft\helpers\Template::fallback("isImage") : (function () { throw new RuntimeError('Variable "isImage" does not exist.', 11, $this->source); })()))) ? ("true") : ("")), "aria-labelledby" => (( // line 12(isset($context["isImage"]) || array_key_exists("isImage", $context) ? $context["isImage"] : (craft\helpers\Template::fallbackExists("isImage") ? craft\helpers\Template::fallback("isImage") : (function () { throw new RuntimeError('Variable "isImage" does not exist.', 12, $this->source); })()))) ? ([( // line 13(isset($context["id"]) || array_key_exists("id", $context) ? $context["id"] : (craft\helpers\Template::fallbackExists("id") ? craft\helpers\Template::fallback("id") : (function () { throw new RuntimeError('Variable "id" does not exist.', 13, $this->source); })())) . "-title") => (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (craft\helpers\Template::fallbackExists("title") ? craft\helpers\Template::fallback("title") : (function () { throw new RuntimeError('Variable "title" does not exist.', 13, $this->source); })())), ( // line 14 { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } ) { } public function render(array $context = []): string { return $this->template->render($context); } public function display(array $context = []) { // using func_get_args() allows to not expose the blocks argument * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ public function render($name, array $context = []): string { return $this->load($name)->render($context); } /** * Displays a template. * // Render and return $renderingTemplate = $this->_renderingTemplate; $this->_renderingTemplate = $template; try { $output = $this->getTwig()->render($template, $variables); } finally { $this->_renderingTemplate = $renderingTemplate; $this->setTemplateMode($oldTemplateMode); } $isRenderingPageTemplate = $this->_isRenderingPageTemplate; $this->_isRenderingPageTemplate = true; try { $this->beginPage(); echo $this->renderTemplate($template, $variables); $this->endPage(); } finally { $this->_isRenderingPageTemplate = $isRenderingPageTemplate; $this->setTemplateMode($oldTemplateMode); $output = ob_get_clean(); $event->roots['@components'] = Craft::getAlias('@root/src/components'); }, ); // Return rendered component Console::stdout(Craft::$app->getView()->renderPageTemplate( "@components/{$template}", $context, View::TEMPLATE_MODE_SITE, )); } catch (\Throwable $exception) { Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); }} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { if ($this->help) { $route = $this->getUniqueId() . '/' . $id; return Yii::$app->runAction('help', [$route]); } return parent::runAction($id, $params); } /** * Binds the parameters to the action. * This method is invoked by [[Action]] when it begins to run with the given parameters. public function runAction($id, $params = []) { try { // *should* only be an int, but there are exceptions :/ /** @var int|null $response */ $response = parent::runAction($id, $params); return $response ?? ExitCode::OK; } finally { if (isset($this->isolationMutexName)) { Craft::$app->getMutex()->release($this->isolationMutexName); } * @inheritdoc */ public function runAction($id, $params = []): int { $this->_actionId = $id; $result = $this->traitRunAction($id, $params); $this->_actionId = null; return $result; } /** if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; * @throws Exception if the route is invalid */ public function runAction($route, $params = []) { try { $res = parent::runAction($route, $params); return is_object($res) ? $res : (int) $res; } catch (InvalidRouteException $e) { throw new UnknownCommandException($route, $this, 0, $e); } } } Console::outputWarning("Craft can’t fetch the `$infoTable` table row." . ($e ? PHP_EOL . 'Exception: ' . $e->getMessage() : ''), false); } } return parent::runAction($route, $params); } /** * @inheritdoc */ */ public function handleRequest($request) { list($route, $params) = $request->resolve(); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); public function handleRequest($request) { // Disable read/write splitting for all console requests $this->getDb()->enableReplicas = false; return parent::handleRequest($request); } /** * Returns the configuration of the built-in commands. * try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE;// Load and run Craft/** @var craft\console\Application $app */// nosemgrep: file-inclusion$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';$exitCode = $app->run();exit($exitCode);|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Variable "icon" does not exist.
at /Users/dennis/Projekte/e-fellows/src/components/0-particles/icon/icon.twig:8
at __TwigTemplate_321007341518e2427952ab1fb14ef339->{closure:__TwigTemplate_321007341518e2427952ab1fb14ef339::doDisplay():55}()
(/Users/dennis/Projekte/e-fellows/storage/runtime/compiled_templates/9c/9c685ec09810ddda1f8e608f51c88997.php:55)
at __TwigTemplate_321007341518e2427952ab1fb14ef339->doDisplay(array('craft' => object(CraftVariable), 'currentSite' => object(Site), 'currentUser' => null, 'primarySite' => object(Site), 'siteName' => 'Für Studierende und Berufstätige', 'siteUrl' => '@web/', 'systemName' => 'e-fellows.net', 'view' => object(View), 'devMode' => true, 'SORT_ASC' => 4, 'SORT_DESC' => 3, 'SORT_REGULAR' => 0, 'SORT_NUMERIC' => 1, 'SORT_STRING' => 2, 'SORT_LOCALE_STRING' => 5, 'SORT_NATURAL' => 6, 'SORT_FLAG_CASE' => 8, 'PHP_INT_MAX' => 9223372036854775807, 'POS_HEAD' => 1, 'POS_BEGIN' => 2, 'POS_END' => 3, 'POS_READY' => 4, 'POS_LOAD' => 5, 'isInstalled' => true, 'loginUrl' => '@web/', 'logoutUrl' => '@web/', 'setPasswordUrl' => null, 'now' => object(DateTime), 'today' => object(DateTime), 'tomorrow' => object(DateTime), 'yesterday' => object(DateTime), '_globals' => object(Collection), 'currentSsoUser' => null, 'login' => object(Entry), 'loginOtc' => object(Entry), 'forgotPassword' => object(Entry), 'title' => false, 'description' => false, 'isImage' => false, 'id' => ''), array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:387)
at Twig\Template->yield(array('craft' => object(CraftVariable), 'currentSite' => object(Site), 'currentUser' => null, 'primarySite' => object(Site), 'siteName' => 'Für Studierende und Berufstätige', 'siteUrl' => '@web/', 'systemName' => 'e-fellows.net', 'view' => object(View), 'devMode' => true, 'SORT_ASC' => 4, 'SORT_DESC' => 3, 'SORT_REGULAR' => 0, 'SORT_NUMERIC' => 1, 'SORT_STRING' => 2, 'SORT_LOCALE_STRING' => 5, 'SORT_NATURAL' => 6, 'SORT_FLAG_CASE' => 8, 'PHP_INT_MAX' => 9223372036854775807, 'POS_HEAD' => 1, 'POS_BEGIN' => 2, 'POS_END' => 3, 'POS_READY' => 4, 'POS_LOAD' => 5, 'isInstalled' => true, 'loginUrl' => '@web/', 'logoutUrl' => '@web/', 'setPasswordUrl' => null, 'now' => object(DateTime), 'today' => object(DateTime), 'tomorrow' => object(DateTime), 'yesterday' => object(DateTime), '_globals' => object(Collection), 'currentSsoUser' => null, 'login' => object(Entry), 'loginOtc' => object(Entry), 'forgotPassword' => object(Entry)), array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:343)
at Twig\Template->display(array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Template.php:358)
at Twig\Template->render(array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/TemplateWrapper.php:35)
at Twig\TemplateWrapper->render(array())
(/Users/dennis/Projekte/e-fellows/vendor/twig/twig/src/Environment.php:320)
at Twig\Environment->render('@components/0-particles/icon/icon.twig', array())
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/web/View.php:570)
at craft\web\View->renderTemplate('@components/0-particles/icon/icon.twig', array())
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/web/View.php:623)
at craft\web\View->renderPageTemplate('@components/0-particles/icon/icon.twig', array(), 'site')
(/Users/dennis/Projekte/e-fellows/src/module/Console/Controller/ComponentController.php:56)
at EFellows\Website\Console\Controller\ComponentController->actionRender('0-particles/icon/icon.twig')
at call_user_func_array(array(object(ComponentController), 'actionRender'), array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/InlineAction.php:57)
at yii\base\InlineAction->runWithParams(array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Controller.php:178)
at yii\base\Controller->runAction('render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Controller.php:180)
at yii\console\Controller->runAction('render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/ControllerTrait.php:88)
at craft\console\Controller->traitRunAction('render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Controller.php:216)
at craft\console\Controller->runAction('render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Module.php:552)
at yii\base\Module->runAction('efellows/component/render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Application.php:180)
at yii\console\Application->runAction('efellows/component/render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Application.php:91)
at craft\console\Application->runAction('efellows/component/render', array('0-particles/icon/icon.twig'))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/console/Application.php:147)
at yii\console\Application->handleRequest(object(Request))
(/Users/dennis/Projekte/e-fellows/vendor/craftcms/cms/src/console/Application.php:122)
at craft\console\Application->handleRequest(object(Request))
(/Users/dennis/Projekte/e-fellows/vendor/yiisoft/yii2/base/Application.php:384)
at yii\base\Application->run()
(/Users/dennis/Projekte/e-fellows/craft:17)
|