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
- 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