Routing in four ways:
http://URL/index.php?m= Group &c= Controller &a= operation method (but this is not safe, not recommended)
http://URL/index.php/Group/Controller/action method (default path mode)
http://Group//Controller/operation method (pseudo-static initial write mode)
http://URL/index.php?s=/Group/Controller/operation method.
View template called by the Controller
$this->display ()
$this->display (template name)
$this->display (Controller/template name)
Existing templates are combined with the framework
1. Copy the template file to the view directory.
2. Copy the css/js/img static source file to the public directory
3. Set constants for the path to the static resource file access.
4. Access static resource files through constants in the template file.
The 5.css file itself has a picture. The picture is set to the relative path access of the CSS file itself.
Create Admin Group
Registration Form Validation
Implementation of the registration function
Completed in the user of the model of the main file
Registration function:
Function Register ({
$-post[' User_hobby ']=implode (', ' $_post[' user_hobby ']);
Change the information of interest from array to string.
$ user=new\model\usermodel ();
Two logic: Presentation and collection
if (!empty ($_post)) {
$shuju = $this->create (); collects the form [$_post] information and returns, while the contact sheet automatically validates, filtering illegal fields.
if ($user->add (Shuju)) {
echo deposited data successfully.
}
}
}
Thinkphp's understanding