I am a newbie to thinkphp entry-level question. I encountered a problem when I tested thinkphp today. please kindly advise: the code is very simple and there is only one IndexAction (automatically generated ), there is an index method and a test method in it. the url mode I use is the rewrite mode ('URL _ Model' & nbsp; = & gt; & n a thinkphp entry-level question
I am a newbie. I am confused when I was studying thinkphp in my test today. please kindly advise:
The code is very simple. there is only one IndexAction (automatically generated), which contains an index method and a test method. the url mode I use is the rewrite mode ('URL _ model' => 2 ), the rewrite rules have been written, but they are always unsuccessful when accessing the test method. according to the manual, it should be http://www.admin.me/index/test. however, the test always reports an error: allow unauthorized access :test (regardless of the case at the beginning of index). why? Isn't the first parameter the module name, and the second parameter the operation name? How can there be two indexes here? My project folder is an App. please kindly advise on the file structure !! Share:
------ Solution --------------------
The first one is the total entry file, the second index is your controller, that is, the file that inherits the action, and the third test is your method, that is, the code block function to be processed, I don't know. Are you clear about this ??? Hope to help you
------ Solution --------------------
So you added the index. php file to the file in the same directory as THINK? You should write something in it,
define('THINK_PATH','./ThinkPHP/');
define('APP_PATH','./home/');
define('APP_NAME','home');
require THINK_PATH.'ThinkPHP.php';
App::run();
?>
You can see that there are a lot of configuration in the configuration of TP. you should not thank the method first. after completing the configuration, you will see the welcome interface and then go to the following ".