laravel-learn-bbs/app/helpers.php
2018-01-01 16:32:20 +08:00

25 lines
444 B
PHP

<?php
/**
* Created by PhpStorm.
* User: xing
* Date: 2017/12/30
* Time: 22:23
*/
function route_class()
{
return str_replace('.', '-', \Illuminate\Support\Facades\Route::currentRouteName());
}
/**
* seo
* @param $value
* @param int $length
* @return string
*/
function make_excerpt($value, $length = 200)
{
$excerpt = trim(preg_replace('/\r\n|\r|\n+/', ' ', strip_tags($value)));
return str_limit($excerpt, $length);
}