Video Learning Transcript---thinkphp---case code

Source: Internet
Author: User

Profiles in 3 Categories: System profiles, grouping profiles, application profiles

① system configuration file thinkphp/conf/convention.php;

② packet/module/platform configuration file home/conf/config.php;

③ application configuration file common/conf/config.php;

(1) Comprehensive case: implementation of OA system login page display

First you need to clarify what conditions are required for the current feature MVC

First, VC

① first is the controller C

Controller: Login log out and put into public, controller name PublicController.class.php

Create the controller file, write the structure code

<? PHP     // Declaration of the namespace     namespace Admin\controller;     // introducing the parent class controller     Use Think\controller;     // declaring the controller and inheriting the parent class    class extends controller{}        }? >

② Next is the presentation template, where you'll set the method

Methods: Method Name Login, write method login, display template file login.html

// login Page Show  Public function Login () {    $this,display ();}

③ the corresponding template file Login.html,v

Copy the template file to the specified location, the specific location of the browser error has been prompted, here prompt location./application/admin/view/public/login.html

<! DOCTYPE html>    account:<input type= "text" name= "name" > <br/>     Password:<input type= "password" name= "pwd" ><br/>    <input type= "Submit" Value= "Login" ></from></body>

④ copy the corresponding static resource file js,css,images to the specified location

Location: root directory, same as application,/public/admin/css or JS or images

⑤ Modifying the introduction path of static resources in template file login.html

This is because the above custom constants __admin__ = __public__/admin, so this can be written

<link rel= "stylesheet" type= "Text/css" href= "__admin__/login.css" >

Equivalent to

<link rel= "stylesheet" type= "Text/css" href= "__public__/admin/login.css" >

Note: In the new version of PHP, even if you do not write methods, you can sometimes display templates. The result can be rendered as long as there is a template with the same name as the method.

Principle: When there is a method, you will first access the method, and then use the template; when there is no method, the template with the same method name will be directly adjusted; If the template does not have a Times error

.

.

Video Learning Transcript---thinkphp---case code

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.