Recently in the use of thinkphp3.2
A logic class was deployed under the \application\content\logic directory: ArticleLogic.class.php
I call in the controller:
$article_logic = new \Content\Logic\AritcleLogic();
System prompt:
Class ' content\logic\aritclelogic ' not found
What's the problem?
Attached Aritclelogic code
namespace Content\Logic;class AritcleLogic { public function remove() { echo 'remove article ...'; } public function save() { } public function history() { }}
Reply content:
Recently in the use of thinkphp3.2
A logic class was deployed under the \application\content\logic directory: ArticleLogic.class.php
I call in the controller:
$article_logic = new \Content\Logic\AritcleLogic();
System prompt:
Class ' content\logic\aritclelogic ' not found
What's the problem?
Attached Aritclelogic code
namespace Content\Logic;class AritcleLogic { public function remove() { echo 'remove article ...'; } public function save() { } public function history() { }}
Did you write use it?
Recommended to see if the path is due to the size of the problem, if it is not good to find the problem, it is recommended that you debug
Find the 162th or so in the thinkphp\library\think\think.class.php
$filename = $path . str_replace('\\', '/', $class) . EXT;
Add below
if($class == 'Content\Logic\AritcleLogic') { //debug_print_backtrace(); var_dump($filename);exit;}
Look where we're actually looking.