Created
May 9, 2014 06:17
-
-
Save mockiemockiz/8c02cfaaa5aeb624d3ad to your computer and use it in GitHub Desktop.
dsfdsfdsfsdfsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: mockie | |
* Date: 4/29/14 | |
* Time: 1:58 PM | |
*/ | |
namespace RealEstate\View\Helper; | |
use Zend\Debug\Debug; | |
use Zend\ServiceManager\ServiceLocatorAwareInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\View\Helper\AbstractHelper; | |
class RealEstateHeadTitleHelper extends AbstractHelper implements ServiceLocatorAwareInterface{ | |
public $title = 'Hommate'; | |
protected $serviceLocator; | |
private $type,$purpose; | |
private $suffix; | |
function __construct(){ | |
// $this->extractUrl(); | |
} | |
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { | |
$this->serviceLocator = $serviceLocator; | |
} | |
public function getServiceLocator() { | |
return $this->serviceLocator; | |
} | |
function getParams(){ | |
return $this->getServiceLocator()->getServiceLocator()->get('ControllerPluginManager')->get('params'); | |
} | |
protected function extractUrl(){ | |
$this->type = $this->getParams()->fromRoute('type',null); | |
$this->purpose = $this->getParams()->fromRoute('for',null); | |
$this->title = $this->type.' '.$this->purpose; | |
} | |
protected function suffix(){ | |
if($this->type){ | |
$this->suffix = $this->view->translate('free from flood, traffic jam'); | |
} | |
} | |
public function __invoke(){ | |
$this->extractUrl(); | |
$this->suffix(); | |
return '<title> Hommate - '.$this->title.' '.$this->suffix.'</title>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment