%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/bbw/farmaci/kritik-portale/module/ReviewBase/src/ReviewBase/Block/
Upload File :
Create Path :
Current File : /var/www/html/bbw/farmaci/kritik-portale/module/ReviewBase/src/ReviewBase/Block/SearchFormBlock.php

<?php
/**
 * Description of SearchFormBlock
 *
 * @author Florian Koller ( conlabz GmbH ) <florian.koller at conlabz.de>
 */

namespace ReviewBase\Block;

use ConLayout\Block\AbstractBlock;
use ReviewBase\Form\SearchForm;

/**
 * @todo remove hardcoded creation of SearchForm inside this class and replace
 * with creation via factory and registered service
 */
class SearchFormBlock extends AbstractBlock
{
    protected $template = 'review-base/search-form';
    
    public function init()
    {
        $searchForm = new SearchForm;
        $searchForm->init();
        $locationID = $this->getRequest()->getQuery('loc_id');
        $searchForm->get('loc_id')->setValue($locationID);
        $placeName = $this->getRequest()->getQuery('place_name');
        $searchForm->get('place_name')->setValue($placeName);
        $userLat = $this->getRequest()->getQuery('user_lat');
        $searchForm->get('user_lat')->setValue($userLat);
        $userLon = $this->getRequest()->getQuery('user_lon');
        $searchForm->get('user_lon')->setValue($userLon);
        $searchString = $this->getRequest()->getQuery('search');
        $searchForm->get('search')->setValue($searchString);
     //   $searchRange = $this->getRequest()->getQuery('range', null);
     //   $searchForm->get('range')->setValue($searchRange);
        $this->setVariables(['searchForm' => $searchForm]);
    }
}

Zerion Mini Shell 1.0