Just a little bit of code.
Assign (' name ', ' Ned '); $smarty->debugging = true; $smarty->display (' Index.tpl ');? >
Code as above, very simple, two pieces of code of the file structure in the same directory
In this way, the operation can not find the class .....
Fatal error:class ' smarty\smarty_test ' is not found in .....
I really do not understand, I am in the thinkphp framework is also using the namespace completely no problem, how to create a new project to put a file, test it is not good or dead .... Even Zend Studio editor can show the existence of smarty_test this class, how to run the time is not,, depressed AH
Reply to discussion (solution)
No one .........
Very good LLL
You did not load the file containing the Smarty_test class definition
You did not load the file containing the Smarty_test class definition
How do I load? Use the include include? Yes, include included in
or set automatic loading
Spl_autoload_register (); Use smarty\smarty_test; $smarty = new Smarty_test (); $smarty->assign (' name ', ' Ned '); $smarty->debugging = true; $smarty->display (' Index.tpl ');