src/Controller/RecipeController.php line 163

  1. <?php
  2. namespace App\Controller;
  3. use Pimcore\Controller\FrontendController;
  4. use Symfony\Bridge\Twig\Attribute\Template;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Contracts\Translation\TranslatorInterface;
  8. use Pimcore\Localization\LocaleServiceInterface;
  9. use Pimcore\Model\DataObject\Recipe;
  10. use Pimcore\Model\DataObject\Review;
  11. use Pimcore\Model\DataObject\RecipeIngredients;
  12. use Pimcore\Model\DataObject\Product;
  13. use Pimcore\Model\DataObject\RecipeTag;
  14. use Pimcore\Model\DataObject\UploadRecipe;
  15. use Pimcore\Model\DataObject;
  16. use Pimcore\Model\DataObject\Commentscount;
  17. use Pimcore\Bundle\PersonalizationBundle\Targeting\VisitorInfoStorageInterface;
  18. use Pimcore\Model\Tool\Targeting;
  19. use Pimcore\Model\Tool\Targeting\TargetGroup;
  20. use Pimcore\Model\DataObject\UserRecipeActivity;
  21. use GeoIp2\Database\Reader;
  22. /**
  23.  * 
  24.  *@IgnoreAnnotation("Template") 
  25.  * @author PcCom
  26.  */
  27. class RecipeController extends FrontendController {
  28.     /**
  29.      * @Template
  30.      *
  31.      * @param Request $request
  32.      *
  33.      * @return array
  34.      */
  35.     /**
  36.      * @var LocaleService
  37.      */
  38.     private $visitorInfoStorage;
  39.     public function __construct(VisitorInfoStorageInterface $visitorInfoStorage) {
  40.         $this->visitorInfoStorage $visitorInfoStorage;
  41.     }
  42.     public function recipesAction() {
  43.         
  44.         $Recipe = new Recipe\Listing();
  45.         $Recipe->setOrder("desc");
  46.         $Recipe->setLimit('4');
  47.         $Recipe->load();
  48.         $Tags = new RecipeTag\Listing();
  49.         $Tags->load();
  50.         $FeaturedRecipe = new Recipe\Listing();
  51.         $FeaturedRecipe->setCondition("featured IN (?)"'1');
  52.         $FeaturedRecipe->load();
  53.         $Products = new Product\Listing();
  54.         $Products->setLimit('3');
  55.         $Products->load();
  56.         $product = [];
  57.         foreach ($Products as $key => $Product) {
  58.             $product[] = $Product;
  59.         }
  60.         $recipe_reviews = new Review\Listing();
  61.         $recipe_reviews->setLimit('5');
  62.         $recipe_reviews->load();
  63.        
  64.         // Region wise ip Handler start
  65.          try {
  66.             $ipaddress '';
  67.             if (isset($_SERVER['HTTP_CLIENT_IP'])) {
  68.                 $ipaddress $_SERVER['HTTP_CLIENT_IP'];
  69.             } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  70.                 $ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
  71.             } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
  72.                 $ipaddress $_SERVER['HTTP_X_FORWARDED'];
  73.             } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
  74.                 $ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
  75.             } else if (isset($_SERVER['HTTP_FORWARDED'])) {
  76.                 $ipaddress $_SERVER['HTTP_FORWARDED'];
  77.             } else if (isset($_SERVER['REMOTE_ADDR'])) {
  78.                 $ipaddress $_SERVER['REMOTE_ADDR'];
  79.             } else {
  80.                 $ipaddress 'UNKNOWN';
  81.             }
  82.             if ($ipaddress != 'UNKNOWN') {
  83.                 $ip_info = new  Reader(__DIR__ '/GeoLite2-Country.mmdb');
  84.                 $record $ip_info->country($ipaddress);
  85.                 if ($record) {
  86.                     $ip $record->country->isoCode;
  87.                 }
  88.             }
  89.         } catch (\Exception $e) {
  90.             $ip '';
  91.         }
  92.         $code $ip// issign country-iso code to code varible
  93.         if ($code == 'AE') {
  94.             $groupids[] = '29';
  95.         } elseif ($code == 'SA') {
  96.             $groupids[] = '27';
  97.         } elseif ($code == 'OM' || $code == 'QA' || $code == 'KW' || $code == 'BH') {
  98.             $groupids[] = '28';
  99.         } else {
  100.             //$code = 'AE';
  101.             $groupids[] = '29';
  102.         }
  103.         $groupids[] = '22';
  104.        
  105.         
  106.         
  107.   
  108.         // Region wise ip Handler end     
  109.         return $this->render('Recipe/recipes.html.twig', [
  110.             'products' => $product,
  111.             'tags' => $Tags,
  112.             'featuredrecipe' => $FeaturedRecipe,
  113.             'recipes' => $Recipe,
  114.             'recipe_reviews' => $recipe_reviews,
  115.             'groupids' => $groupids,
  116.             'country' => $code,
  117.         ]);
  118.     }
  119.     public function allrecipesAction() {
  120.         $Recipe = new Recipe\Listing();
  121.         $Recipe->setOrderKey("id");
  122.         $Recipe->setOrder("desc");
  123.         $Recipe->load();
  124.         $Tags = new RecipeTag\Listing();
  125.         $Tags->load();
  126.         $recipe_reviews = new Review\Listing();
  127.         $recipe_reviews->load();
  128.         // $NewRecipes = new UploadRecipe\Listing();
  129.         // $NewRecipes->setCondition("status In (?)","ApprovePublished");
  130.         // $NewRecipes->load();
  131.         return $this->render('Recipe/allrecipes.html.twig', [
  132.             'tags' => $Tags,
  133.             'recipes' => $Recipe,
  134.             'recipe_reviews' => $recipe_reviews,
  135.             //'newRecipes'=>$NewRecipes,
  136.         ]);
  137.     }
  138.     public function recipedetailsAction(Request $request) {
  139.       
  140.         // Region wise ip Handler start
  141.         try {
  142.             $ipaddress '';
  143.             if (isset($_SERVER['HTTP_CLIENT_IP'])) {
  144.                 $ipaddress $_SERVER['HTTP_CLIENT_IP'];
  145.             } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  146.                 $ipaddress $_SERVER['HTTP_X_FORWARDED_FOR'];
  147.             } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
  148.                 $ipaddress $_SERVER['HTTP_X_FORWARDED'];
  149.             } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
  150.                 $ipaddress $_SERVER['HTTP_FORWARDED_FOR'];
  151.             } else if (isset($_SERVER['HTTP_FORWARDED'])) {
  152.                 $ipaddress $_SERVER['HTTP_FORWARDED'];
  153.             } else if (isset($_SERVER['REMOTE_ADDR'])) {
  154.                 $ipaddress $_SERVER['REMOTE_ADDR'];
  155.             } else {
  156.                 $ipaddress 'UNKNOWN';
  157.             }
  158.             if ($ipaddress != 'UNKNOWN') {
  159.                 $ip_info = new  Reader(__DIR__ '/GeoLite2-Country.mmdb');
  160.                 $record $ip_info->country($ipaddress);
  161.                 if ($record) {
  162.                     $ip $record->country->isoCode;
  163.                 }
  164.             }
  165.         } catch (\Exception $e) {
  166.             $ip '';
  167.         }
  168.         $code $ip// issign country-iso code to code varible
  169.      
  170.     
  171.         if ($code == 'AE') {
  172.             $groupids[] = '29';
  173.         } elseif ($code == 'SA') {
  174.             $groupids[] = '27';
  175.         } elseif ($code == 'OM' || $code == 'QA' || $code == 'KW' || $code == 'BH') {
  176.             $groupids[] = '28';
  177.         } else {
  178.             //$code = 'AE';
  179.             $groupids[] = '29';
  180.         }
  181.         // Region wise ip Handler end    
  182.         $url $request->get('url');
  183.         $recipedetails = new Recipe\Listing();
  184.         $recipedetails->setCondition("url = ?", [$url]);
  185.         $recipedetails->load();
  186.         foreach ($recipedetails as $key => $recipedata) {
  187.             $recipe $recipedata;
  188.             break;
  189.         }
  190.         $recipeid =   $recipedata->getId();
  191.        
  192.         $reviews = new Review\Listing();
  193.         $reviews->setCondition("recipe_id__id IN (?)"$recipedata->getId());
  194.         $reviews->setOrderKey("id");
  195.         $reviews->setOrder("desc");
  196.         $reviews->load();
  197.         $reviewcount = [];
  198.         if ($reviews) {
  199.             foreach ($reviews as $key => $review) {
  200.                 $reviewcount[] = $review->getName();
  201.             }
  202.             $reviewcounts count($reviewcount);
  203.         } else {
  204.             $reviewcounts "0";
  205.         }
  206.        
  207.         $commentscount = new Commentscount\Listing();
  208.         $commentscount->setlimit(1);
  209.         $commentscount->load();
  210.         $myRecipe = new Recipe\Listing();
  211.         //$myRecipe->setCondition("typeofmeal LIKE ?" , ['%Dessert%']);
  212.         $myRecipe->load();
  213.     
  214.         $featuredrecipe = new Recipe\Listing();
  215.         $featuredrecipe->setCondition("url != ? and featured IN (?)", [$url'1']);
  216.         $featuredrecipe->setlimit(4);
  217.         $featuredrecipe->load();
  218.     
  219.         //Loyalty user activity
  220.        /* if($this->get('session')){
  221.             $userid = $this->get('session')->get('loginUID');
  222.         }*/
  223.        
  224.        // $recipeid = $recipe->getId();
  225.       
  226.        /* $Liked = new UserRecipeActivity\Listing();
  227.         $Liked->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Like', $userid, $recipeid]);
  228.         $Liked->load();
  229.         if (count($Liked) == 1) {
  230.             $Likedcount = 1;
  231.         } else {
  232.             $Likedcount = 0;
  233.         }
  234.         
  235.         $Shared = new UserRecipeActivity\Listing();
  236.         $Shared->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Share', $userid, $recipeid]);
  237.         $Shared->load();
  238.         if (count($Shared) == 1) {
  239.             $Sharedcount = 1;
  240.         } else {
  241.             $Sharedcount = 0;
  242.         }
  243.         $Saved = new UserRecipeActivity\Listing();
  244.         $Saved->setCondition("recipeoption = ? and user_id__id = ? and recipe_id__id = ?", ['Save', $userid, $recipeid]);
  245.         $Saved->load();
  246.         if (count($Saved) == 1) {
  247.             $Savedcount = 1;
  248.         } else {
  249.             $Savedcount = 0;
  250.         }*/
  251.         //Loyalty user activity ends
  252.         return $this->render('Recipe/recipesdetail.html.twig', [
  253.             'recipedetails' => $recipedata,
  254.             'ratingcount' => $reviewcounts,
  255.             'reviewcount' => $reviewcounts,
  256.             'count' => $commentscount,
  257.             'reviews' => $reviews,
  258.             'myrecipes' => $myRecipe,
  259.             'featuredrecipe' => $featuredrecipe,
  260.             'featuredreviews' => [],
  261.             'country' => $code,
  262.             //'country'=>'AE',  // temporary basses
  263.             'groupids' => $groupids,
  264.             'Likedcount' => 0,
  265.             'Sharedcount' =>0,
  266.             'Savedcount' => 0,
  267.         ]);
  268.     }
  269.     public function searchbytagAction(Request $request) {
  270.         $url htmlspecialchars($request->get('id'));
  271.         $Recipe = new Recipe\Listing();
  272.         // if($url == 'featured'){
  273.         //     $Recipe->setCondition("featured IN (?)", '1');
  274.         //     $id = $request->get('id2');
  275.         // }
  276.         $Recipe->load();
  277.         $Recipes = [];
  278.         $tagURL "";
  279.         foreach ($Recipe as $key => $recipe) {
  280.             for ($i 0$i count($recipe->getTags()); $i++) {
  281.                 if ($recipe->getTags()[$i]) {
  282.                     if ($recipe->getTags()[$i]->getUrl() == $url) {
  283.                         $Recipes[] = $recipe;
  284.                         if ($tagURL == "") {
  285.                             if ($request->getLocale() == 'ar') {
  286.                                 $tagURL $recipe->getTags()[$i]->getUrl("en");
  287.                             } else {
  288.                                 $tagURL $recipe->getTags()[$i]->getUrl("ar");
  289.                             }
  290.                         }
  291.                     }
  292.                 }
  293.             }
  294.         }
  295.         $Tags = new RecipeTag\Listing();
  296.         $Tags->load();
  297.         $recipe_reviews = new Review\Listing();
  298.         $recipe_reviews->load();
  299.         return $this->render('Recipe/recipesearchbytag.html.twig', [
  300.             'tags' => $Tags,
  301.             'recipes' => $Recipes,
  302.             'tagURL' => $tagURL,
  303.             'recipe_reviews' => $recipe_reviews,
  304.         ]);
  305.     }
  306.     public function searchAction(Request $request) {
  307.        
  308.         $q strip_tags($request->get('q'));
  309.         $Recipe = new Recipe\Listing();
  310.         $Recipe->setCondition("name LIKE ? or url LIKE ? ", ["%" $q "%""%" $q "%"]);
  311.         $Recipe->load();
  312.         $FeaturedProduct = new Product\Listing();
  313.         $FeaturedProduct->setCondition("featured IN (?)"'1');
  314.         $FeaturedProduct->load();
  315.         $Tags = new RecipeTag\Listing();
  316.         $Tags->load();
  317.         $RecipeIng = new RecipeIngredients\Listing();
  318.         $RecipeIng->load();
  319.         return $this->render('Recipe/recipe_searchby_name.html.twig', [
  320.             'tags' => $Tags,
  321.             'recipes' => $Recipe,
  322.             'name' => "Search query: $q",
  323.             'recipeingredients' => $RecipeIng,
  324.             'featuredproduct ' => $FeaturedProduct
  325.         ]);
  326.     }
  327.     /**
  328.      * @Route("/{locale}/reviews", name="recipe_review")
  329.      */
  330.     public function reviewAction(Request $request) {
  331.         $success 0;
  332.         $session $request->getSession();
  333.         if (empty($_POST['g-recaptcha-response'])) {
  334.             $success 1;
  335.             return $this->json(array('success' => $success));
  336.             // $session->getFlashBag()->add('recaptcha-error', 'Please check the the captcha form.');
  337.             // $this->addFlash('warning', 'Please check the the captcha form.');
  338.             // return $this->redirect($request->headers->get('referer').'#message-alertt');
  339.         }
  340.         $secret $secretdev '6LePrpohAAAAANEprm30tyI4ltm2Tcgw8kO_BbEV';
  341.         $url 'https://www.google.com/recaptcha/api/siteverify?secret=' urlencode($secret) .  '&response=' urlencode($_POST['g-recaptcha-response']);
  342.         // $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
  343.         $verifyResponse file_get_contents($url);
  344.         $responseData json_decode($verifyResponse);
  345.         if ($responseData->success == false) {
  346.             $success 1;
  347.             return $this->json(array('success' => $success));
  348.             // $session->getFlashBag()->add('recaptcha-error', 'Please check the the captcha form.');
  349.             // $this->addFlash('warning', 'Please check the the captcha form.');
  350.             // return $this->redirect($request->headers->get('referer').'#message-alertt');
  351.         }
  352.         if ($request->get('recipe_id')) {
  353.             $recipe Recipe::getById($request->get('recipe_id'));
  354.             try {
  355.                 $params = [
  356.                     'name' => $request->get('name'),
  357.                     'email' => $request->get('email'),
  358.                     'comment' => $request->get('comment'),
  359.                     'rating' => $request->get('rating'),
  360.                 ];
  361.                 $Review = new Review();
  362.                 $Review->setKey(strtotime(date('Y-m-d H:i:s')) . htmlspecialchars($request->get('email')));
  363.                 $Review->setParent(DataObject\Folder::getByPath('/Review/'));
  364.                 $Review->setName(strip_tags($request->get('name')));
  365.                 $Review->setEmail(strip_tags($request->get('email')));
  366.                 $Review->setComment(strip_tags($request->get('comment')));
  367.                 $Review->setRating($request->get('addreviewrating'));
  368.                 $Review->setRecipe_id($recipe);
  369.                 $Review->setPublished(false);
  370.                 $d $Review->save();
  371.                 if ($d) {
  372.                     $success 2;
  373.                     return $this->json(array('success' => $success));
  374.                     // $session->getFlashBag()->add('success', 'Thank you for your feedback.');
  375.                     // return $this->redirect($request->headers->get('referer').'#message-alertt');
  376.                 }
  377.             } catch (\Exception $e) {
  378.                 print_r($e->getMessage());
  379.             }
  380.         }
  381.         // $locale = $request->getLocale();
  382.         // if($locale == 'ar'){
  383.         //    return $this->redirect('/ar/كل-الوصفات/'.$request->get('recipe_url'), 301);
  384.         // }else{
  385.         //    return $this->redirect('/en/all-recipes/'.$request->get('recipe_url'), 301);
  386.         // }
  387.         return $this->json(array('success' => $success));
  388.     }
  389.     public function getadvancefiltermodal() {
  390.         $RecipeIng = new RecipeIngredients\Listing();
  391.       //  $RecipeIng->setCondition("featureingrident IN (?)", '1');
  392.         $RecipeIng->load();
  393.         $FeaturedProduct = new Product\Listing();
  394.         $FeaturedProduct->setCondition("featured IN (?)"'1');
  395.         $FeaturedProduct->load();
  396.         return $this->render('Recipe/advancefilterModal_includes.html.twig', [
  397.             'recipeingredients' => $RecipeIng,
  398.             'featuredproduct' => $FeaturedProduct,
  399.         ]);
  400.     }
  401.     /**
  402.      * @Route("/{locale}/filterrecipes", name="filterrecipes")
  403.      */
  404.     public function searchfilterAction(Request $request) {
  405.         // dd("hello");
  406.         if (count($request->query->all()) < 1) {
  407.             $referer $request->headers->get('referer');
  408.             return $this->redirect($referer);
  409.         }
  410.         $strBCond "";
  411.         $localCond "";
  412.         // $check = false;
  413.         $Recipe = new Recipe\Listing();
  414.         if ($request->get('product')) {
  415.             $product $request->get('product');
  416.             for ($i 0$i count($product); $i++) {
  417.                 if ($i 0) {
  418.                     $localCond .= " OR ";
  419.                 }
  420.                 //$localCond .= "product LIKE'%" . $product[$i] . "%'";
  421.                 $localCond .= "featured_product LIKE " $Recipe->quote("%," $product[$i] . ",%");
  422.             }
  423.             // $conn .= " OR ";
  424.             if ($localCond != "") {
  425.                 $strBCond " ( " $localCond " ) ";
  426.                 $localCond "";
  427.             }
  428.         }
  429.         if ($request->get('Ing')) {
  430.             $ingrident $request->get('Ing');
  431.             for ($i 0$i count($ingrident); $i++) {
  432.                 if ($i 0) {
  433.                     $localCond .= " OR ";
  434.                 }
  435.                 $localCond .= "ing LIKE " $Recipe->quote("%" $ingrident[$i] . "%");
  436.             }
  437.             if ($localCond != "") {
  438.                 if ($strBCond != "") {
  439.                     $strBCond .= " and ";
  440.                 }
  441.                 $strBCond .= " ( " $localCond " ) ";
  442.                 $localCond "";
  443.             }
  444.         }
  445.         if ($request->get('time60')) {
  446.             $localCond .= "time <= 60";
  447.         } else if ($request->get('time30')) {
  448.             if ($localCond != "") {
  449.                 $localCond .= " OR ";
  450.             }
  451.             $localCond .= "time <= 30";
  452.         } else if ($request->get('time15')) {
  453.             if ($localCond != "") {
  454.                 $localCond .= " OR ";
  455.             }
  456.             $localCond .= "time <= 15";
  457.         }
  458.         if ($localCond != "") {
  459.             if ($strBCond != "") {
  460.                 $strBCond .= " and ";
  461.             }
  462.             $strBCond .= " ( " $localCond " ) ";
  463.             $localCond "";
  464.         }
  465.         //Time End
  466.         //Serving Start
  467.         $servingParams = [];
  468.         if ($request->get('serving01')) {
  469.             array_push($servingParams1);
  470.             // $localCond .= "serving = 1 OR serving2 = 1";
  471.         }
  472.         if ($request->get('serving02')) {
  473.             array_push($servingParams2);
  474.             // if($localCond != ""){
  475.             //     $localCond .= " OR ";
  476.             // }
  477.             // $localCond .= "serving = 2 OR serving2 = 2";
  478.         }
  479.         if ($request->get('serving03')) {
  480.             array_push($servingParams3);
  481.             // if($localCond != ""){
  482.             //     $localCond .= " OR ";
  483.             // }
  484.             // $localCond .= "serving = 3 OR serving2 = 3";
  485.         }
  486.         if ($request->get('serving04')) {
  487.             array_push($servingParams4);
  488.             // if($localCond != ""){
  489.             //     $localCond .= " OR ";
  490.             // }
  491.             // $localCond .= "serving = 4 OR serving2 = 4";
  492.         }
  493.         if ($request->get('serving05')) {
  494.             array_push($servingParams5);
  495.             // if($localCond != ""){
  496.             //     $localCond .= " OR ";
  497.             // }
  498.             // $localCond .= "serving = 5 OR serving2 = 5";
  499.         }
  500.         if ($request->get('serving06')) {
  501.             array_push($servingParams6);
  502.             // if($localCond != ""){
  503.             //     $localCond .= " OR ";
  504.             // }
  505.             // $localCond .= "serving = 6 OR serving2 = 6";
  506.         }
  507.         if ($request->get('serving07')) {
  508.             array_push($servingParams7);
  509.             // if($localCond != ""){
  510.             //     $localCond .= " OR ";
  511.             // }
  512.             // $localCond .= "serving = 7 OR serving2 = 7";
  513.         }
  514.         if ($request->get('serving08')) {
  515.             array_push($servingParams8);
  516.             // if($localCond != ""){
  517.             //     $localCond .= " OR ";
  518.             // }
  519.             // $localCond .= "serving = 8 OR serving2 = 8";
  520.         }
  521.         if ($request->get('serving09')) {
  522.             array_push($servingParams9);
  523.             // if($localCond != ""){
  524.             //     $localCond .= " OR ";
  525.             // }
  526.             // $localCond .= "serving = 9 OR serving2 = 9";
  527.         }
  528.         if ($request->get('serving10')) {
  529.             array_push($servingParams10);
  530.             // if($localCond != ""){
  531.             //     $localCond .= " OR ";
  532.             // }
  533.             // $localCond .= "serving = 10 OR serving2 = 10";
  534.         }
  535.         // if($localCond != ""){
  536.         //     if($strBCond != ""){
  537.         //         $strBCond .= " and ";
  538.         //     }
  539.         //     $strBCond .= " ( ". $localCond ." ) ";
  540.         //     $localCond = "";
  541.         // }
  542.         //End Serving
  543.         //Start Cusine
  544.         if ($request->get('cusine')) {
  545.             $cusine[] = $request->get('cusine');
  546.             for ($i 0$i count($cusine); $i++) {
  547.                 if ($i 0) {
  548.                     $localCond .= " OR ";
  549.                 }
  550.                 $localCond .= "cusine LIKE " $Recipe->quote("%" $cusine[$i] . "%");
  551.                 $para[] = $cusine[$i];
  552.             }
  553.             if ($localCond != "") {
  554.                 if ($strBCond != "") {
  555.                     $strBCond .= " and ";
  556.                 }
  557.                 $strBCond .= " ( " $localCond " ) ";
  558.                 $localCond "";
  559.             }
  560.         }
  561.         $Recipes = [];
  562.         if ($strBCond != "") {
  563.             $Recipe->setCondition($strBCond);
  564.         }
  565.         $Recipe->load();
  566.         $Tags = new RecipeTag\Listing();
  567.         $Tags->load();
  568.         $recipe_reviews = new Review\Listing();
  569.         $recipe_reviews->load();
  570.         return $this->render('Recipe/advancefilter.html.twig', [
  571.             'tags' => $Tags,
  572.             'recipes' => $Recipe,
  573.             'name' => "Advance Search",
  574.             'recipe_reviews' => $recipe_reviews,
  575.         ]);
  576.     }
  577. }