return $text;
}
public function getNameAr(): string
{
return $this->nameAr;
}
public function setNameAr(string $nameAr): void
{
$this->nameAr = $nameAr;
}
// Some objects throw exceptions when they have __call, and the method we try
// to call is not supported. If ignoreStrictCheck is true, we should return null.
try {
$ret = $object->$method(...$arguments);
} catch (\BadMethodCallException $e) {
if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
return;
}
throw $e;
echo "\">
<div>
<div class=\"title\">
";
// line 9
if (((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.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9) == "ar") && 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.', 9, $this->source); })()), "nameAr", [], "any", false, false, false, 9))) {
// 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 " ";
}
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();
foreach ($context['_seq'] as $context["index"] => $context["product"]) {
// line 16
echo " <div class=\"col-12 col-sm-6 col-md-4\">
";
// line 17
$this->loadTemplate("component/boxes.html.twig", "component/products-list.html.twig", 17)->display(twig_array_merge($context, ["product" => $context["product"]]));
// line 18
echo " </div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
}
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();
// line 57
echo " </div>
<div class=\"col-12 col-md-9 space-top\">
";
// line 59
$this->loadTemplate("component/products-list.html.twig", "website/ad-search.html.twig", 59)->display(twig_array_merge($context, ["list" => [0 => "icon-1.png", 1 => "icon-2.png", 2 => "icon-3.png", 3 => "icon-4.png", 4 => "icon-5.png", 5 => "icon-6.png", 6 => "icon-7.png", 7 => "icon-8.png", 8 => "icon-9.png"]]));
// line 60
echo " </div>
</div>
</div>
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/ad-search.html.twig"));
$this->parent = $this->loadTemplate("websiteBase.html.twig", "website/ad-search.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();
}
$sql .= ' AND product.id IN (' . $productsID . ') ';
}
$materials = $conn->fetchAllAssociative($sql);
return $this->render('website/ad-search.html.twig', ['countOfResults' => $countOfResults, 'curretPage' => $page, 'categories' => $categories, 'families' => $families, 'brands' => $brands, 'products' => $products, 'materials' => $materials, 'SupplierCompanys' => $SupplierCompanys, 'searchTerms' => $searchTerms, 'selectedCompanies' => $selectedCompanies, 'selectedBrands' => $selectedBrands, 'selectedMaterial' => $selectedMaterial, 'length' => $length, 'lengthUnit' => $lengthUnit, 'height' => $height, 'heightUnit' => $heightUnit, 'width' => $width, 'widthUnit' => $widthUnit, 'diameter' => $diameter, 'diameterUnit' => $diameterUnit, 'wieght' => $wieght, 'wieghtUnit' => $wieghtUnit, 'selectedCategory' => $selectedCategory, 'selectedfamilies' => $selectedfamilies, 'water' => $water, 'thermal' => $thermal, 'mounting' => $mounting, 'colors' => $colors, 'selectedcolors' => $selectedcolors]);
}
}
$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
TypeError
|
---|
TypeError: App\Entity\Product::getNameAr(): Return value must be of type string, null returned at src/Entity/Product.php:1175 at App\Entity\Product->getNameAr() (vendor/twig/twig/src/Extension/CoreExtension.php:1607) at twig_get_attribute() (var/cache/dev/twig/18/18c04afdec5b16ad046f6f309f921ede.php:59) 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/d7/d76de7d37126d5f0738edd12deb6aff8.php:76) at __TwigTemplate_64b5e544d18c9817d96ec8d137053ca7->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/89/89825ca2f4ca6cc2ed8b8f437fde246c.php:161) at __TwigTemplate_eac54407ba7d949cadbc251fff1562a6->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/89/89825ca2f4ca6cc2ed8b8f437fde246c.php:47) at __TwigTemplate_eac54407ba7d949cadbc251fff1562a6->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/SearchController.php:348) at App\Controller\SearchController->searchByWord() (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) |