作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

修改头部SEO标题

@@ -15,14 +15,20 @@ class Index extends Frontend @@ -15,14 +15,20 @@ class Index extends Frontend
15 protected $limit = 20; 15 protected $limit = 20;
16 protected $page = 1; 16 protected $page = 1;
17 protected $group = 8;//分组 17 protected $group = 8;//分组
  18 + protected $title = '';
18 protected $keys = ''; 19 protected $keys = '';
19 protected $description = ''; 20 protected $description = '';
20 21
21 public function _initialize() 22 public function _initialize()
22 { 23 {
23 parent::_initialize(); 24 parent::_initialize();
  25 + //SEO标题
  26 + $title = Db::table('fa_config')->where('id',1)->find();
  27 + $this->title = $title['value'];
  28 + //SEO关键字
24 $keys = Db::table('fa_config')->where('id',18)->find(); 29 $keys = Db::table('fa_config')->where('id',18)->find();
25 $this->keys = $keys['value']; 30 $this->keys = $keys['value'];
  31 + //SEO描述
26 $description = Db::table('fa_config')->where('id',19)->find(); 32 $description = Db::table('fa_config')->where('id',19)->find();
27 $this->description = $description['value']; 33 $this->description = $description['value'];
28 } 34 }
@@ -46,7 +52,8 @@ class Index extends Frontend @@ -46,7 +52,8 @@ class Index extends Frontend
46 } 52 }
47 $this->assign('custom',$arr); 53 $this->assign('custom',$arr);
48 54
49 - //关键字,描述 55 + //SEO标题关键字,描述
  56 + $this->assign('title',$this->title);
50 $this->assign('keys',$this->keys); 57 $this->assign('keys',$this->keys);
51 $this->assign('description',$this->description); 58 $this->assign('description',$this->description);
52 return $this->fetch(); 59 return $this->fetch();
@@ -76,7 +83,8 @@ class Index extends Frontend @@ -76,7 +83,8 @@ class Index extends Frontend
76 $this->assign('list',$news); 83 $this->assign('list',$news);
77 $this->assign('top',$top); 84 $this->assign('top',$top);
78 85
79 - //关键字,描述 86 + //SEO标题关键字,描述
  87 + $this->assign('title',$this->title);
80 $this->assign('keys',$this->keys); 88 $this->assign('keys',$this->keys);
81 $this->assign('description',$this->description); 89 $this->assign('description',$this->description);
82 return $this->fetch(); 90 return $this->fetch();
@@ -110,7 +118,8 @@ class Index extends Frontend @@ -110,7 +118,8 @@ class Index extends Frontend
110 $this->assign('hot',$hot); 118 $this->assign('hot',$hot);
111 $this->assign('detail',$detail); 119 $this->assign('detail',$detail);
112 120
113 - //关键字,描述 121 + //SEO标题关键字,描述
  122 + $this->assign('title',$this->title);
114 $this->assign('keys',$this->keys); 123 $this->assign('keys',$this->keys);
115 $this->assign('description',$this->description); 124 $this->assign('description',$this->description);
116 return $this->fetch(); 125 return $this->fetch();
@@ -118,7 +127,8 @@ class Index extends Frontend @@ -118,7 +127,8 @@ class Index extends Frontend
118 127
119 public function map() 128 public function map()
120 { 129 {
121 - //关键字,描述 130 + //SEO标题关键字,描述
  131 + $this->assign('title',$this->title);
122 $this->assign('keys',$this->keys); 132 $this->assign('keys',$this->keys);
123 $this->assign('description',$this->description); 133 $this->assign('description',$this->description);
124 return $this->fetch(); 134 return $this->fetch();
@@ -126,7 +136,8 @@ class Index extends Frontend @@ -126,7 +136,8 @@ class Index extends Frontend
126 136
127 public function course() 137 public function course()
128 { 138 {
129 - //关键字,描述 139 + //SEO标题关键字,描述
  140 + $this->assign('title',$this->title);
130 $this->assign('keys',$this->keys); 141 $this->assign('keys',$this->keys);
131 $this->assign('description',$this->description); 142 $this->assign('description',$this->description);
132 return $this->fetch(); 143 return $this->fetch();
@@ -134,7 +145,8 @@ class Index extends Frontend @@ -134,7 +145,8 @@ class Index extends Frontend
134 145
135 public function contact() 146 public function contact()
136 { 147 {
137 - //关键字,描述 148 + //SEO标题关键字,描述
  149 + $this->assign('title',$this->title);
138 $this->assign('keys',$this->keys); 150 $this->assign('keys',$this->keys);
139 $this->assign('description',$this->description); 151 $this->assign('description',$this->description);
140 return $this->fetch(); 152 return $this->fetch();
@@ -142,7 +154,8 @@ class Index extends Frontend @@ -142,7 +154,8 @@ class Index extends Frontend
142 154
143 public function business() 155 public function business()
144 { 156 {
145 - //关键字,描述 157 + //SEO标题关键字,描述
  158 + $this->assign('title',$this->title);
146 $this->assign('keys',$this->keys); 159 $this->assign('keys',$this->keys);
147 $this->assign('description',$this->description); 160 $this->assign('description',$this->description);
148 return $this->fetch(); 161 return $this->fetch();
@@ -150,7 +163,8 @@ class Index extends Frontend @@ -150,7 +163,8 @@ class Index extends Frontend
150 163
151 public function about() 164 public function about()
152 { 165 {
153 - //关键字,描述 166 + //SEO标题关键字,描述
  167 + $this->assign('title',$this->title);
154 $this->assign('keys',$this->keys); 168 $this->assign('keys',$this->keys);
155 $this->assign('description',$this->description); 169 $this->assign('description',$this->description);
156 return $this->fetch(); 170 return $this->fetch();
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>关于我们</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/about.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/about.css">
10 </head> 10 </head>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>业务介绍</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/business.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/business.css">
10 </head> 10 </head>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>联系我们</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/contact.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/contact.css">
10 </head> 10 </head>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>课程体系</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/course.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/course.css">
10 </head> 10 </head>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>首页</title> 7 + <title>{$title}</title>
8 <meta name="viewport" content="width=1200"> 8 <meta name="viewport" content="width=1200">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/swiper/swiper.min.css"> 10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/swiper/swiper.min.css">
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>新闻资讯</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/swiper/swiper.min.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/swiper/swiper.min.css">
10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/news.css"> 10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/news.css">
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="keywords" content="{$keys}"> 5 <meta name="keywords" content="{$keys}">
6 <meta name="description" content="{$description}"> 6 <meta name="description" content="{$description}">
7 - <title>新闻资讯</title> 7 + <title>{$title}</title>
8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css"> 8 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/public.css">
9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/swiper/swiper.min.css"> 9 <link rel="stylesheet" type="text/css" href="__CDN__/assets/swiper/swiper.min.css">
10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/news.css"> 10 <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/news.css">