Business use method of ZPF framework

Source: Internet
Author: User

March 9, 2015 10:58:42

Controller is the place to accept data assignment tasks

The business receives the data from the controller, obtains and processes The data in the database, and returns it to the logic layer of the controller.

A controller dispatches a task to invoke a business logic layer

The calling notation is:

$this->loadbusiness (' Test ')->test ();

At the same time, business can also call each other:

$this->main->loadbusiness (' Test ')->test ();

Querying data in the database in business:

1      Public function GetName () 2     {3         $where = "' initial ' = ' z '"; 4         $fields = ' name Pinyin initial '; 5         return $this->getlink (' name ')->select ($where$fields); 6     }

where the GetLink () function is the link database to obtain data, the parameter name is the bottom of the configuration file in the 19th row of the array key name:

1 classConfig2 {3     //mysql link param4      Public Static $lcdbparam=Array(5' Host ' = ' 127.0.0.1 ',6' Username ' = ',7' Password ' = ',8         );9 Ten      Public Static $remotedbparam=Array( One' Host ' = ', A' Username ' = ', -' Password ' = ', -' Default ' = ' the         ); -  -     //Table Info -      Public Static $tableinfo=Array( +' Name ' = = ' Test name Lcdbparam ', -' Tiezi ' = ' bbs tiezi remotedbparam ' +         ); A}

Note: The framework does not have a clear model layer, the so-called model layer is the upper database/table configuration file, the real function of the model layer is the business (logic) layer

Business use method of ZPF framework

Related Article

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.