PHPStudy:http://phpstudy.php.cn/
PHPstrom破解
C:\Windows\System32\drivers\etc\hosts
(无法访问时直接全路径访问)
(无法修改时使用Notepad打开,修改文件只读权限)
添加:0.0.0.0 account.jetbrains.com
获取注册码:http://idea.lanyus.com/
配置ThinkPHP
PHPstudy打开根目录
新建文件夹(项目)
将ThinkPHP解压到当前目录
配置域名
添加hosts
访问域名
phpstrom
快捷键设置
ThinkPHP内置标签
https://blog.csdn.net/lgsh1988/article/details/54024254
去除url中的index.php应用入口
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
重点是?号
// http://www.edu.com/index.php/index/user/login
// 域名/ 应用/ 模块/控制器/操作(函数)
H-ui admin 模板配置
将Hui模板中的staitc和lib复制到Think的public/static中
创建Base类继承Controller类
配置index视图继承Base
渲染index首页
修改首页index静态资源目录(Think模板渲染在thinkphp/library/think/View.php中查看和修改)
公共模块分离,在view中创建public公共模块
创建父模板base.html
引入公共模块:{include file="public/header" /}
创建区块block
{block name="seo"}
base为所有模板的父模板
区块block内容由子模板定义
网站标题关键字与描述
{/block}
父模板中基本只会用到include(导入public中的公共页面,默认起始位置为view)和block(区块,由用户自定义代码)
子模板中只有extend(继承)和block(区块)
子模板必须实现继承父模板的所有区块,否则会显示父模板中的内容
子模板中使用{__block__}可引入父模板中相应区块的内容
load标签可简化引入静态资源(css/js)
{load href="__STATIC__/static/h-ui/js/H-ui.js"}
{load href="__STATIC__/static/h-ui/css/H-ui.min.css"}