推荐文章(下面的发错链接了)https://www.insp.top/article/learn-laravel-container。适合结合设计模式看
2016-01-28
推荐文章:https://www.insp.top/article/learn-laravel-request-and-response
2016-01-28
还是需要去工厂类实例化的
$db=Immoc\Factory::creatDb();//这部不能少
$db=Immoc\Register::get('db1');
$db->order();
$db=Immoc\Factory::creatDb();//这部不能少
$db=Immoc\Register::get('db1');
$db->order();
2016-01-28
final class Registry {
private $data = array();
public function get($key) {
return (isset($this->data[$key]) ? $this->data[$key] : null);
}
public function set($key, $value) {
$this->data[$key] = $value;
}
public function has($key) {
return isset($this->data[$key]);
}
}
private $data = array();
public function get($key) {
return (isset($this->data[$key]) ? $this->data[$key] : null);
}
public function set($key, $value) {
$this->data[$key] = $value;
}
public function has($key) {
return isset($this->data[$key]);
}
}
2016-01-28
<?php
define('BASEDIR',__DIR__);
// include()
spl_autoload_register();
Immoc\Object::test();
App\Controller\Home\Index::test();
不用写load就行。
define('BASEDIR',__DIR__);
// include()
spl_autoload_register();
Immoc\Object::test();
App\Controller\Home\Index::test();
不用写load就行。
2016-01-27