public function shorten($args, Mustache_LambdaHelper $helper) {
        // Split the text into an array of variables.
        list($length, $text) = explode(',', $args, 2);
        $length = trim($length);
        $text = trim($text);

        // Allow mustache tags in the text.
        $text = $helper->render($text);

        return shorten_text($text, $length);
    }
public function shorten($args, Mustache_LambdaHelper $helper) {
        // Split the text into an array of variables.
        list($length, $text) = explode(',', $args, 2);
        $length = trim($length);
        $text = trim($text);

        // Allow mustache tags in the text.
        $text = $helper->render($text);

        return shorten_text($text, $length);
    }
public function shorten ( $ args , Mustache_LambdaHelper $ helper ) { // Split the text into an array of variables. list ( $ length , $ text ) = explode ( ',' , $ args , 2 ) ; $ length = trim ( $ length ) ; $ text = trim ( $ text ) ; // Allow mustache tags in the text. $ text = $ helper -> render ( $ text ) ; return shorten_text ( $ text , $ length ) ; }
Read a length and text component from the string.

{{#shortentext}}50,Some test to shorten{{/shortentext}}

Both args are required. The length must come first.

@param string $args The text to parse for arguments.
@param Mustache_LambdaHelper $helper Used to render nested mustache variables.
@return string
Read a length and text component from the string .