create-your-own-php-framework
create-your-own-php-framework copied to clipboard
构建自己的PHP框架
十二章,Compiler类中 public function compile($file = null, $params = []) { $path = '../views/'.$file.'.sf'; extract($params); if (!$this->isExpired($path)) { $compiled = $this->getCompiledPath($path); require_once $compiled; return; } $fileContent = file_get_contents($path); $result = '';...
那么好的文章怎么没人看了,醉了
在第三节中,web控制器引用base控制器的命名空间是绝对应引用和/project/controllers/siteController中的相对引用名字冲突了。  现在这样会出现命名空间嵌套出错。 这里将/project/src/web/Controllers.php中的引用改为如下: use sf\base\Controller as BaseController; class Controller extends BaseController