Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:27:38+00:00 2026-06-14T00:27:38+00:00

Templating not found form_div_layout.html.twig Path in twig loader: Array ( [0] => /var/www/nrp.new-generation.com.ua/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views )

  • 0

Templating not found form_div_layout.html.twig

Path in twig loader:

Array ( [0] => /var/www/nrp.new-generation.com.ua/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views )

Why not added default paths?

Error:

Unable to find template "form_div_layout.html.twig" in Service:AbstractService::layout.html.twig at line 27.

Twig_Loader_Exception:

Twig_Error_Loader: Unable to find template "form_div_layout.html.twig" (looked into: /var/www/{path}/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views).

EDIT:

I replace default TemplateNameParser in TwigLoader for add me logik load templates.

My TemplateNameParser:

    <?php

namespace NRP\Bundles\ServiceBundle\Twig;

use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser as BaseTemplateNameParser,
    Symfony\Component\Templating\TemplateReferenceInterface;

/**
 *
 */
class TemplateNameParser extends BaseTemplateNameParser
{
  /**
   * {@inheritdoc}
   */
  public function parse($name)
  {
    if ($name instanceof TemplateReferenceInterface) {
      return $name;
    }
    else if (isset($this->cache[$name])) {
      return $this->cache[$name];
    }

    // If not service prefix
    if (strpos($name, 'Service:') !== 0) {
      return parent::parse($name);
    }

    // Find template
    $name = str_replace(':/', ':', preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')));

    if (false !== strpos($name, '..')) {
      throw new \RuntimeException(sprintf('Template name "%s" contains invalid characters.', $name));
    }

    $parts = explode(':', $name);
    if (4 !== count($parts)) {
      throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid (format is "Service:{ServiceName}:{Section}:{template}.{format}.{engine}").', $name));
    }

    $elements = explode('.', $parts[3]);
    if (3 > count($elements)) {
      throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid (format is "Service:{ServiceName}:{Section}:{template}.{format}.{engine}").', $name));
    }

    $engine = array_pop($elements);
    $format = array_pop($elements);

    $template = new TemplateReference($parts[1], $parts[2], implode('.', $elements), $format, $engine);

    if (!$template->hasService()) {
      throw new \RuntimeException(sprintf('Not found service "%s".', $template->get('service')));
    }

    return $this->cache[$name] = $template;
  }
}

And add to services:

<!-- Twig file system loader -->
<service id="nrp.twig.name_parser" class="NRP\Bundles\ServiceBundle\Twig\TemplateNameParser">
  <argument type="service" id="kernel" />
</service>
<service id="twig.loader" class="Symfony\Bundle\TwigBundle\Loader\FilesystemLoader">
  <argument type="service" id="templating.locator" />
  <argument type="service" id="nrp.twig.name_parser" />
</service>

If disabled this loader, all OK!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:27:39+00:00Added an answer on June 14, 2026 at 12:27 am

    This problem solved!

    Solution:

    Replace parameter templating.name_parser.class;

    Example:

    <parameters>
        <!-- Parameter for TemplatingNameParser -->
        <parameter key="templating.name_parser.class">NRP\Bundles\ServiceBundle\Twig\TemplateNameParser</parameter>
      </parameters>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

And which templating library should new beginner user? Not sure if OS matter,I'm talking
I am working on templating system. I do have input of html document from
Is there a good way of doing templating (that allows me to write html
In HTML I can build a simple templating system by providing a template in
I am using Twig as a templating engine. However, I ran in a situation
As it's not currently possible for me to use a json templating engine (jbuilder
I am working on templating in PHP. I know there are templating engines out
I have a templating system that looks similar to old-style ASP code. I run
I'm using Django templating with Google App Engine. I'm trying unsuccessfully to print out
I'm building a templating system and I'm running in to an issue with calling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.