include_once需要查詢一遍已加載的文件列表, 確認(rèn)是否存在, 然后再加載,此操作勢(shì)必對(duì)效率有所影響。所以使用include并自己建立映射記錄提高效率
2017-03-27
看了你這集,model 類是幾次medoo, 如:class model extends \Medoo{}, 我操作 報(bào)這個(gè)錯(cuò)誤 "Class 'Medoo' not found",沒看到你那引入 medoo類,是composer 自動(dòng)加載了, include "vendor/autoload.php"; 這個(gè)也引入了,可還是報(bào) 這個(gè)錯(cuò)誤 :"Class 'Medoo' not found"
2017-03-23
坑我也踩到了, 然后我看了看是display方法里面的問題.
大家找到display方法.
把里面的
$file= APP.'/views/'.$file;if(is_file($file)){
改成
$path = APP.'/views/'.$file; if(is_file($path)){
把
$template = $twig->load('index.html');
改成
$template = $twig->load($file);
?
不用謝, 我是雷鋒. 哈哈
大家找到display方法.
把里面的
$file= APP.'/views/'.$file;if(is_file($file)){
改成
$path = APP.'/views/'.$file; if(is_file($path)){
把
$template = $twig->load('index.html');
改成
$template = $twig->load($file);
?
不用謝, 我是雷鋒. 哈哈
2017-03-13
$count的值直接count($patharr) 就行了,為什么還要count($patharr)+2 多此一舉
其實(shí)可以這樣寫:
$i = 2;
while ($i<=count($path)) {
$_GET[$path[$i]] = $path[$i+1];
$i+=2;
}
前提是存在$patharr[0]與$patharr[1]時(shí) 先要將$patharr[0]與$patharr[1]釋放掉
其實(shí)可以這樣寫:
$i = 2;
while ($i<=count($path)) {
$_GET[$path[$i]] = $path[$i+1];
$i+=2;
}
前提是存在$patharr[0]與$patharr[1]時(shí) 先要將$patharr[0]與$patharr[1]釋放掉