赞
踩
- /**
- * 生成页面Heading
- *
- * @param string $path 指定的path
- * @return string
- */
- function build_heading($path = null, $container = true)
- {
- $title = $content = '';
- if (is_null($path)) {
- $action = request()->action();
- $controller = str_replace('.', '/', request()->controller());
- $path = strtolower($controller . ($action && $action != 'index' ? '/' . $action : ''));
- }
- // 根据当前的URI自动匹配父节点的标题和备注
- $data = Db::name('auth_rule')->where('name', $path)->field('title,remark')->find();
- if ($data) {
- $title = __($data['title']);
- $content = __($data['remark']);
- }
- if (!$content) {
- return '';
- }
- $result = '<div class="panel-lead"><em>' . $title . '</em>' . $content . '</div>';
- if ($container) {
- $result = '<div class="panel-heading">' . $result . '</div>';
- }
- return $result;
- }

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。