RuntimeError

HTTP 500 Whoops, looks like something went wrong.

Variable "icon" does not exist.

Exception

Twig\Error\ RuntimeError

Show exception properties
Twig\Error\RuntimeError {#643
  -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
    """
}
  1. {% set isImage = title or description %}
  2. {% set id = isImage ? (id ??? html_id('icon')) -%}
  3. <svg {{ html_attributes({
  4. id: id,
  5. class: ['icon', 'icon--' ~ icon, class ?? ''],
  6. viewBox: viewBox ??? '0 0 200 200',
  7. role: isImage ? 'img',
  8. 'aria-hidden': not isImage ? 'true',
  9. 'aria-labelledby': isImage ? {
  10. (id ~ '-title'): title,
__TwigTemplate_321007341518e2427952ab1fb14ef339->{closure:__TwigTemplate_321007341518e2427952ab1fb14ef339::doDisplay():55}() in /Users/dennis/Projekte/e-fellows/storage/runtime/compiled_templates/9c/9c685ec09810ddda1f8e608f51c88997.php (line 55)
  1. $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")))) : (""));
  2. // line 6
  3. yield "<svg ";
  4. yield twig_html_extended_attributes($this->env, ["id" => // line 7
  5. (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
  6. (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
  7. (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
  8. (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
  9. (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
  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.', 12, $this->source); })()))) ? ([( // line 13
  11. (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
  1. {
  2. $context += $this->env->getGlobals();
  3. $blocks = array_merge($this->blocks, $blocks);
  4. try {
  5. yield from $this->doDisplay($context, $blocks);
  6. } catch (Error $e) {
  7. if (!$e->getSourceContext()) {
  8. $e->setSourceContext($this->getSourceContext());
  9. }
  1. return $this->blocks;
  2. }
  3. public function display(array $context, array $blocks = []): void
  4. {
  5. foreach ($this->yield($context, $blocks) as $data) {
  6. echo $data;
  7. }
  8. }
  9. public function render(array $context): string
  1. ob_start();
  2. } else {
  3. ob_start(function () { return ''; });
  4. }
  5. try {
  6. $this->display($context);
  7. } catch (\Throwable $e) {
  8. while (ob_get_level() > $level) {
  9. ob_end_clean();
  10. }
  1. ) {
  2. }
  3. public function render(array $context = []): string
  4. {
  5. return $this->template->render($context);
  6. }
  7. public function display(array $context = [])
  8. {
  9. // using func_get_args() allows to not expose the blocks argument
  1. * @throws SyntaxError When an error occurred during compilation
  2. * @throws RuntimeError When an error occurred during rendering
  3. */
  4. public function render($name, array $context = []): string
  5. {
  6. return $this->load($name)->render($context);
  7. }
  8. /**
  9. * Displays a template.
  10. *
  1. // Render and return
  2. $renderingTemplate = $this->_renderingTemplate;
  3. $this->_renderingTemplate = $template;
  4. try {
  5. $output = $this->getTwig()->render($template, $variables);
  6. } finally {
  7. $this->_renderingTemplate = $renderingTemplate;
  8. $this->setTemplateMode($oldTemplateMode);
  9. }
  1. $isRenderingPageTemplate = $this->_isRenderingPageTemplate;
  2. $this->_isRenderingPageTemplate = true;
  3. try {
  4. $this->beginPage();
  5. echo $this->renderTemplate($template, $variables);
  6. $this->endPage();
  7. } finally {
  8. $this->_isRenderingPageTemplate = $isRenderingPageTemplate;
  9. $this->setTemplateMode($oldTemplateMode);
  10. $output = ob_get_clean();
View->renderPageTemplate('@components/0-particles/icon/icon.twig', array(), 'site') in /Users/dennis/Projekte/e-fellows/src/module/Console/Controller/ComponentController.php (line 56)
  1. $event->roots['@components'] = Craft::getAlias('@root/src/components');
  2. },
  3. );
  4. // Return rendered component
  5. Console::stdout(Craft::$app->getView()->renderPageTemplate(
  6. "@components/{$template}",
  7. $context,
  8. View::TEMPLATE_MODE_SITE,
  9. ));
  10. } catch (\Throwable $exception) {
ComponentController->actionRender('0-particles/icon/icon.twig')
  1. Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
  2. if (Yii::$app->requestedParams === null) {
  3. Yii::$app->requestedParams = $args;
  4. }
  5. return call_user_func_array([$this->controller, $this->actionMethod], $args);
  6. }
  7. }
  1. $result = null;
  2. if ($runAction && $this->beforeAction($action)) {
  3. // run the action
  4. $result = $action->runWithParams($params);
  5. $result = $this->afterAction($action, $result);
  6. // call afterAction on modules
  7. foreach ($modules as $module) {
  1. if ($this->help) {
  2. $route = $this->getUniqueId() . '/' . $id;
  3. return Yii::$app->runAction('help', [$route]);
  4. }
  5. return parent::runAction($id, $params);
  6. }
  7. /**
  8. * Binds the parameters to the action.
  9. * This method is invoked by [[Action]] when it begins to run with the given parameters.
  1. public function runAction($id, $params = [])
  2. {
  3. try {
  4. // *should* only be an int, but there are exceptions :/
  5. /** @var int|null $response */
  6. $response = parent::runAction($id, $params);
  7. return $response ?? ExitCode::OK;
  8. } finally {
  9. if (isset($this->isolationMutexName)) {
  10. Craft::$app->getMutex()->release($this->isolationMutexName);
  11. }
  1. * @inheritdoc
  2. */
  3. public function runAction($id, $params = []): int
  4. {
  5. $this->_actionId = $id;
  6. $result = $this->traitRunAction($id, $params);
  7. $this->_actionId = null;
  8. return $result;
  9. }
  10. /**
  1. if (is_array($parts)) {
  2. /* @var $controller Controller */
  3. list($controller, $actionID) = $parts;
  4. $oldController = Yii::$app->controller;
  5. Yii::$app->controller = $controller;
  6. $result = $controller->runAction($actionID, $params);
  7. if ($oldController !== null) {
  8. Yii::$app->controller = $oldController;
  9. }
  10. return $result;
  1. * @throws Exception if the route is invalid
  2. */
  3. public function runAction($route, $params = [])
  4. {
  5. try {
  6. $res = parent::runAction($route, $params);
  7. return is_object($res) ? $res : (int) $res;
  8. } catch (InvalidRouteException $e) {
  9. throw new UnknownCommandException($route, $this, 0, $e);
  10. }
  11. }
  1. }
  2. Console::outputWarning("Craft can’t fetch the `$infoTable` table row." . ($e ? PHP_EOL . 'Exception: ' . $e->getMessage() : ''), false);
  3. }
  4. }
  5. return parent::runAction($route, $params);
  6. }
  7. /**
  8. * @inheritdoc
  9. */
  1. */
  2. public function handleRequest($request)
  3. {
  4. list($route, $params) = $request->resolve();
  5. $this->requestedRoute = $route;
  6. $result = $this->runAction($route, $params);
  7. if ($result instanceof Response) {
  8. return $result;
  9. }
  10. $response = $this->getResponse();
  1. public function handleRequest($request)
  2. {
  3. // Disable read/write splitting for all console requests
  4. $this->getDb()->enableReplicas = false;
  5. return parent::handleRequest($request);
  6. }
  7. /**
  8. * Returns the configuration of the built-in commands.
  9. *
  1. try {
  2. $this->state = self::STATE_BEFORE_REQUEST;
  3. $this->trigger(self::EVENT_BEFORE_REQUEST);
  4. $this->state = self::STATE_HANDLING_REQUEST;
  5. $response = $this->handleRequest($this->getRequest());
  6. $this->state = self::STATE_AFTER_REQUEST;
  7. $this->trigger(self::EVENT_AFTER_REQUEST);
  8. $this->state = self::STATE_SENDING_RESPONSE;
Application->run() in /Users/dennis/Projekte/e-fellows/craft (line 17)
  1. // Load and run Craft
  2. /** @var craft\console\Application $app */
  3. // nosemgrep: file-inclusion
  4. $app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';
  5. $exitCode = $app->run();
  6. exit($exitCode);

Stack Trace

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)