123456789101112131415161718192021222324252627 |
- <?php
- /**
- * 添加自定义辅助函数
- */
- if ( ! function_exists('config_path'))
- {
- /**
- * Get the configuration path.
- *
- * @param string $path
- * @return string
- */
- function config_path($path = '')
- {
- return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
- }
- function subtext($text, $length)
- {
- if(mb_strlen($text, 'utf8') > $length) {
- return mb_substr($text, 0, $length, 'utf8').'...';
- } else {
- return $text;
- }
- }
- }
|