最近在用thinkphp3.2
在\Application\Content\Logic目录下部署了一个logic类:ArticleLogic.class.php
我在Controller里面调用:
<code class="lang-php">$article_logic = new \Content\Logic\AritcleLogic();</code>
系统提示:
Class ‘Content\Logic\AritcleLogic’ not found
是什么问题呢
附AritcleLogic代码
<code class="lang-php">namespace Content\Logic;class AritcleLogic { public function remove() { echo 'remove article ...'; } public function save() { } public function history() { }}</code>
回复内容:
、本文来源gao($daima.com搞@代@#码$网搞gaodaima代码
最近在用thinkphp3.2
在\Application\Content\Logic目录下部署了一个logic类:ArticleLogic.class.php
我在Controller里面调用:
<code class="lang-php">$article_logic = new \Content\Logic\AritcleLogic();</code>
系统提示:
Class ‘Content\Logic\AritcleLogic’ not found
是什么问题呢
附AritcleLogic代码
<code class="lang-php">namespace Content\Logic;class AritcleLogic { public function remove() { echo 'remove article ...'; } public function save() { } public function history() { }}</code>
你写use
了么?
建议看看是不是路径因为大小写的问题导致的,如果还不好找问题的话,建议你debug下
在ThinkPHP\Library\Think\Think.class.php中找到第162左右
<code class="lang-php">$filename = $path . str_replace('\\', '/', $class) . EXT;</code>
下面增加
<code class="lang-php">if($class == 'Content\Logic\AritcleLogic') { //debug_print_backtrace(); var_dump($filename);exit;}</code>
看看实际寻找到哪里去了