Thinkphp's understanding

Source: Internet
Author: User
Tags array to string

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.