public function renderWithMaxLength($string, $max = 0, $dots = true)
    {
        $field = $this->renderNakedField($string);

        if(mb_strlen($field) > $max && $max > 0)
        {
            $break  = "*-*-*";
            $wrap   = wordwrap($field, $max, $break);
            $items  = explode($break, $wrap);
            $string = (isset($items[0]) ? $items[0] : "") . ($dots ? "..." : "");
        }


        return $string;
    }
public function renderWithMaxLength($string, $max = 0, $dots = true)
    {
        $field = $this->renderNakedField($string);

        if(mb_strlen($field) > $max && $max > 0)
        {
            $break  = "*-*-*";
            $wrap   = wordwrap($field, $max, $break);
            $items  = explode($break, $wrap);
            $string = (isset($items[0]) ? $items[0] : "") . ($dots ? "..." : "");
        }


        return $string;
    }
public function renderWithMaxLength ( $ string , $ max = 0 , $ dots = true ) { $ field = $ this -> renderNakedField ( $ string ) ; if ( mb_strlen ( $ field ) > $ max && $ max > 0 ) { $ break = "*-*-*" ; $ wrap = wordwrap ( $ field , $ max , $ break ) ; $ items = explode ( $ break , $ wrap ) ; $ string = ( isset ( $ items [ 0 ] ) ? $ items [ 0 ] : "" ) . ( $ dots ? "..." : "" ) ; } return $ string ; }
Check string length and return him summary or in original
@param $string
@param int $max Max. length of string
@param bool|true $dots add "..." after summary string
@return string
Check string length and return him summary or in original