Essence\Provider\Presenter\Templater::present PHP Method

present() public method

{@inheritDoc}
public present ( Media $Media )
$Media Essence\Media
    public function present(Media $Media)
    {
        $switch = $Media->get($this->_switch);
        if ($switch && !$Media->has($this->_property)) {
            foreach ($this->_templates as $pattern => $template) {
                if (preg_match($pattern, $switch)) {
                    $Media->set($this->_property, Template::compile($template, $Media->properties(), 'htmlspecialchars'));
                    break;
                }
            }
        }
        return $Media;
    }