views_ui_truncate($string, $length)
Truncate strings to a set length and provide a '...' if they truncated.
This is often used in the UI to ensure long strings fit.
File
- core/modules/views_ui/views_ui.module, line 321
- Provide structure for the administrative interface to Views.
Code
1 2 3 4 5 6 7 8 | function views_ui_truncate( $string , $length ) { if (Unicode:: strlen ( $string ) > $length ) { $string = Unicode:: substr ( $string , 0, $length ); $string .= '...' ; } return $string ; } |
Please login to continue.