From 1495378a4bfab30f312b22980609ad9d9a34610a Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 9 Oct 2023 23:41:59 +0300 Subject: [PATCH] argument pass optiomization --- templates/default/layout.html.twig | 8 ++++++-- templates/default/search/index.html.twig | 10 +--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index f91a1c2..ee1308a 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -18,7 +18,11 @@ {% block header_search %} {{ render(controller( - 'App\\Controller\\SearchController::module' + 'App\\Controller\\SearchController::module', + { + query : app.request.get('query'), + type : app.request.get('type') + } )) }} {% endblock %} @@ -33,7 +37,7 @@ {% block main_profile %} {{ render(controller( 'App\\Controller\\UserController::module', - {route : app.request.get('_route')} + { route : app.request.get('_route') } )) }} {% endblock %} {% block main_content %}{% endblock %} diff --git a/templates/default/search/index.html.twig b/templates/default/search/index.html.twig index 9ede45e..61d0da3 100644 --- a/templates/default/search/index.html.twig +++ b/templates/default/search/index.html.twig @@ -1,10 +1,2 @@ {% extends 'default/layout.html.twig' %} -{% block title %}{{ query }} - {{'Search'|trans }} - {{ name }}{% endblock %} -{% block header_search %} - {{ render(controller( - 'App\\Controller\\SearchController::module', - { - query : query - } - )) }} -{% endblock %} \ No newline at end of file +{% block title %}{{ query }} - {{'Search'|trans }} - {{ name }}{% endblock %} \ No newline at end of file