<a href="{{ url('product_details', {'id': product.id , 'name': product.itemNum|replace({'/': ''})|url_encode}) }}">
<div>
<div class="title">
{% if app.request.locale=='ar' and product.nameAr %}
{% set name= product.nameAr %}
{% elseif app.request.locale=='fr' and product.nameFr %}
{% set name= product.nameFr %}
{% else %}
{% set name= product.itemNum %}
{% endif %}
{# {% if name|length > 44 %} #}
// line 10
echo " ";
$context["name"] = twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 10, $this->source); })()), "nameAr", [], "any", false, false, false, 10);
// line 11
echo " ";
} elseif (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 11, $this->source); })()), "request", [], "any", false, false, false, 11), "locale", [], "any", false, false, false, 11) == "fr") && twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 11, $this->source); })()), "nameFr", [], "any", false, false, false, 11))) {
// line 12
echo " ";
$context["name"] = twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 12, $this->source); })()), "nameFr", [], "any", false, false, false, 12);
// line 13
echo " ";
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["index"] => $context["product"]) {
// line 17
echo " ";
$this->loadTemplate("component/boxes.html.twig", "component/products-slider.html.twig", 17)->display(twig_array_merge($context, ["product" => $context["product"]]));
// line 18
echo " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
<div class=\"container\">
<div class=\"row\">
<div class=\"col-12\">
";
// line 166
$this->loadTemplate("component/products-slider.html.twig", "website/home.html.twig", 166)->display(twig_array_merge($context, ["title" => "Latest Products", "products" => (isset($context["latestProducts"]) || array_key_exists("latestProducts", $context) ? $context["latestProducts"] : (function () { throw new RuntimeError('Variable "latestProducts" does not exist.', 166, $this->source); })())]));
// line 167
echo " </div>
<div class=\"col-12\">
";
// line 169
throw new \LogicException('A block must be a method on a \Twig\Template instance.');
}
if (null !== $template) {
try {
$template->$block($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($template->getSourceContext());
}
</script>
<div id=\"main-content\">
";
// line 311
$this->displayBlock('content', $context, $blocks);
// line 314
echo "</div>
<script type=\"text/javascript\">
\$(document).ready(function () {
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
$macros = $this->macros;
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "website/home.html.twig"));
$this->parent = $this->loadTemplate("websiteBase.html.twig", "website/home.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
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
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
}
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.
*
{
if (!$this->container->has('twig')) {
throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
}
return $this->container->get('twig')->render($view, $parameters);
}
/**
* Renders a view.
*/
/**
* Renders a view.
*/
protected function render(string $view, array $parameters = [], Response $response = null): Response
{
$content = $this->renderView($view, $parameters);
if (null === $response) {
$response = new Response();
}
$sectors = $entityManager
->getRepository(ZSectors::class)
->findBy([], ['id' => 'ASC']);
return $this->render('website/home.html.twig', ['latestProducts' => $latestProducts, 'topSelling' => $topSelling, 'trending' => $trending, 'mostFavored' => $latestProducts, 'suppliers' => $suppliers, 'services' => $services, 'sectors' => $sectors]);
}
}
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return fn(array $context) => new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
No log messages
RuntimeError
|
---|
Twig\Error\RuntimeError: Neither the property "nameFr" nor one of the methods "nameFr()", "getnameFr()"/"isnameFr()"/"hasnameFr()" or "__call()" exist and have public access in class "App\Entity\Product". at templates/component/boxes.html.twig:11 at twig_get_attribute() (var/cache/dev/twig/18/18c04afdec5b16ad046f6f309f921ede.php:65) at __TwigTemplate_9c620ff5ab761609683b25ac13349ecf->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (var/cache/dev/twig/9d/9dfa59328a816adf7370b35d9ab300fd.php:98) at __TwigTemplate_d5ae8f5951530df675414ea7dddca93f->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (var/cache/dev/twig/cb/cbe1c2bb65de2766709eb4079c033769.php:188) at __TwigTemplate_41df182bf813414c322cd6b817b85899->block_content() (vendor/twig/twig/src/Template.php:171) at Twig\Template->displayBlock() (var/cache/dev/twig/2e/2e2216f5de7257b3f416d9edf5e9f372.php:484) at __TwigTemplate_12c51a56b9208cca46433ec0bc84fca5->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (var/cache/dev/twig/cb/cbe1c2bb65de2766709eb4079c033769.php:46) at __TwigTemplate_41df182bf813414c322cd6b817b85899->doDisplay() (vendor/twig/twig/src/Template.php:394) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:367) at Twig\Template->display() (vendor/twig/twig/src/Template.php:379) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:40) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:277) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:222) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (vendor/symfony/framework-bundle/Controller/AbstractController.php:230) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render() (src/Controller/HomePageController.php:49) at App\Controller\HomePageController->HomePage() (vendor/symfony/http-kernel/HttpKernel.php:153) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/var/www/html/website/vendor/autoload_runtime.php') (public/index.php:5) |