Statistics
7205
4
0
1.1y
Badges
Dependencies

Latte - email helper/filter

Small Latte helper/filter based on Smarty idea to protect your email address.


Build Status Downloads total Latest stable HHVM Status

Discussion / Help

Join the chat

Install

$ composer require minetro/latte-email

Encodings

  • javascript
  • javascript_charcode
  • hex
  • drupal
  • texy

Usage

{var $mail = "my@email.net"}

{$mail|email:"javascript"}
{$mail|email:"javascript_charcode"}
{$mail|email:"hex"|noescape}
{$mail|email:"javascript":"link to my email here"}
{$mail|email:"drupal"}
{$mail|email:"texy"}

Install

Config

services:
    nette.latteFactory:
        setup:
            - addFilter('email', 'Minetro\Latte\Helpers\EmailHelper::mailto')
            # or
            - addFilter('email', ['Minetro\Latte\Helpers\EmailHelper', 'mailto'])

Presenter/Control

public function createTemplate() 
{
    $template = parent::createTemplate();
    $template->addFilter('email', ['Minetro\Latte\Helpers\EmailHelper', 'mailto']);
}

TemplateFactory


use Nette\Application\UI\Control;
use Nette\Bridges\ApplicationLatte\Template;

final class TemplateFactory extends Nette\Bridges\ApplicationLatte\TemplateFactory
{
    /**
     * @param Control $control
     * @return Template
     */
    public function createTemplate(Control $control = NULL)
    {
        $template = parent::createTemplate($control);
        $template->addFilter('email', ['Minetro\Latte\Helpers\EmailHelper', 'mailto']);
        return $template;
    }
}

No release at this moment. Try to create first one.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com