Twig_Environment::getCharset PHP Method

getCharset() public method

public getCharset ( )
    public function getCharset()
    {
        return $this->charset;
    }

Same methods

Twig_Environment::getCharset ( ) : string

Usage Example

 function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $separator = '...')
 {
     if (mb_strlen($value, $env->getCharset()) > $length) {
         return mb_substr($value, 0, $length, $env->getCharset()) . $separator;
     }
     return $value;
 }
All Usage Examples Of Twig_Environment::getCharset