## SEO
- SEO优化是网站灵魂所在,所以这里的SEO设置也非常的简单
设置文件/html/www/demo/test/seo/demo1/data.php内容如下
```
<?php
return [
'title' => 'SEO Title',
'keywords' => 'SEO Keywords',
'description' => 'SEO Description',
];
```
打开网址[http://demo.tphp.com/test/seo/demo1](http://demo.tphp.com/test/seo/demo1)获得如下效果(查看源码)![](/static/plugins/tphp/help/module/seo/demo1.png)
设置文件/html/www/demo/test/seo/demo2/data.php内容如下
```
<?php
return [
'title' => 'SEO Title',
'keywords' => 'SEO Keywords',
'description' => 'SEO Description',
];
```
设置文件/html/www/demo/test/seo/demo2/_init.php内容如下
```
<?php
return function (){
// 改设置可以存放于 _init.php 和 set.php 文件的任意位置
seo([
'title' => 'TPHP 标题',
'keywords' => 'TPHP 关键词',
'description' => 'TPHP 描述'
]);
// 或者
//__title("TPHP 标题");
//__keywords("TPHP 关键词");
//__description("TPHP 描述");
// 获取SEO数据
// dump(seo());
// dump(__title());
// dump(__keywords());
// dump(__description());
};
```
打开网址[http://demo.tphp.com/test/seo/demo2](http://demo.tphp.com/test/seo/demo2)获得如下效果(查看源码)![](/static/plugins/tphp/help/module/seo/demo2.png)
- 可以看到seo() 设置优先级高于 data.php 设置