2017-12-30 15:45:21 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created by PhpStorm.
|
|
|
|
* User: xing
|
|
|
|
* Date: 2017/12/30
|
|
|
|
* Time: 22:23
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
function route_class()
|
|
|
|
{
|
|
|
|
return str_replace('.', '-', \Illuminate\Support\Facades\Route::currentRouteName());
|
2018-01-01 08:32:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2017-12-30 15:45:21 +00:00
|
|
|
}
|