login.html代码{include file="/public/head"} <body class="login-bg">...
325
一.登陆实现 * 登陆方法,就是在验证登陆模板传过来的数据(username.password),依据用户名来查询User数据表,如果存在并密码正确,则将用户名传入SESSI...
287
view\user\index.html{include file="/public/head"} <body> &nbs...
555
<meta charset="utf-8"><?phpclass Person{ public $name; ...
242
依赖注入:将当前依赖的对象以参数的方式注入到当前类中,简称依赖注入实例:<?php //对象依赖注入class Girl{ public function work(){ retur...
741
<?php //连接数据库 $pdo = new PDO('mysql:host=127.0.0.1;dbname=php_edu;charset=utf8...
249
一.后台主页模板分离 将重复的内容header,提出来,放在public目录,创建header.html中,然后将其导入到所用的模板中index.html...
541
<?php class SportObject { public $name;  ...
361
<?php //1.连接数据库 $pdo = new PDO('mysql:host=127.0.0.1;dbname=php_edu;charset=ut...
235
<?php //1.连接数据库 $pdo = new PDO('mysql:host=127.0.0.1;dbname=php_edu;charset=ut...
168
<?php //1.连接数据库 $pdo = new PDO('mysql:host=127.0.0.1;dbname=php_edu;charset=ut...
272
<?php namespace app\index\controller; use think\Controller; use app\index\mo...
242
工厂模式:根据用户需求动态生成类的实例:用于解决类之间的高度依赖关系示例:<?php //工厂模式:根据用户需求动态生成类的实例class Computer{ public funct...
278
<?php class Person { public function work() &...
353
类和对象的定义,类中成员属性和常量的使用,类的自动加载机制,类的封装机制。<?phpclass Sport{ public $name; pu...
153