THINKCMF development--About controllers

Source: Internet
Author: User

First, installation

Install --- remove install file -- Delete index.php-- Modify database Information -- Create a database

Modify database information:\data\conf\db.php(including server address)

Second, create mobile app Project

1. Create a folder: Add project files under application mobile-- in config.php module_allow_list added in Mobile , create conf and the Common folder First letter capitalization

    1. To create a control file:

namespace Mzdocmobile\controller;

Use Common\controller\appframecontroller;

Class Indexcontroller extends appframecontroller{

Public Function login () {

}

Public Function Register () {

}

There are several base classes under the thinkcmfx series version of Application/common/controller :

|-appframecontroller-----THINKCMF Framework Control base class, inheriting to Action

|-adminbasecontroller-----THINKCMF Framework Background control base class, inheriting to Appframecontroller

|-homebasecontroller-----THINKCMF Framework foreground control base class, inherit to Appframecontroller

|-memberbasecontroller-----THINKCMF Framework member control base class, inherit to Homebasecontroller

ForAdminbasecontrollerand theHomebasecontrollerThey're an important method.Display,the templates for managing background and foreground are displayed separately, if yourActioninherited theadminbaseaction, when you callDisplaymethod, it will help you to findTpl_admindirectory of files, the sameHomebasecontrollerwill help you find it.TPLdirectory of files, so that a good implementation of the front and rear template separation.

For Memberbasecontroller, the Controller thatinherits this class will help you judge the member's related actions, such as whether the user has logged in, whether the user has access to the URL .

3. Create a data table, and note the table prefix added.

Configure new project:common--config.php---module_allow_list

Three

Four

THINKCMF development--About controllers

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.