About the CI framework for PHP

Source: Internet
Author: User
Tags autoload

Today review of the CI Framework, and re-wrote some of the CI framework of trivial  1, CAKEPHP,THINKPHP2.CI framework CI http://localhost/myci2/controller name/method name http://localhost/ Myci2/welcome/index3. MVC (model View Controller models, views, controllers) 4. Design pattern to make logic clearer 5.route (routing) 6.redirect (' This is the path of the Jump '): Redirect, cannot pass the parameter, does not support the second parameter to send two requests $this->load->view jump altogether on a request, loading the file, does not cause the path change, will pass the parameter 7. Form:get Post This difference gets is used to obtain, post is used to submit, only the form is the Post8action property is used to match the request of the submission, path. is the relative path (a method under controller/Controller) actiom= "Welcome/save", Run will not find the Save method, a more welcome, workaround, add a base base path tag in head: <base href = "<?php echo site_url ();? > "> To start it to automatically load under, in config, open autoload.php,67 line into $autoload [' Helper ']=array (' url '); Also remove index.php interference: in config.php, 29 lines $config[' index_page ']= '; 9. Controller call MODEL10. Configuration of the database:application>config> autoload>55 row Plus ' database ' automatically loads the database application>config>database51 line configuration database information at program startup, Hostname is the domain name and the following username11.htaccess control file access rights 12.ajax (Async JS and XML) Interview 13. How to configure the CI framework: Create a project under Htdocs, codeIgniter-2.2.6 application,system,index.php to the project, there is a hidden file:. htaccessindex.php is a portal file, and the page is displayed in the Views directory, and all files are accessed indirectly through index.php. HTAccess is a control that is configured to access the directory system is the underlying file that is running, almost without the route under config: To forward the request, you can change the default controller front page in the route to write 14 in the views file. Controller: 1. Accept Data 2 Authentication (A Boolean identifier bit that identifies whether successful, true indicates successful commit) True//A Boolean identity bit to identify success, true commit= Array//VerificationIf$username ' $data ' err_name ' Please enter your username '$flagfalseif$password$repassword$data ' err_pwd ' two times password inconsistent '$flagfalseif$flag$thisload' Regist ' $data 3. Connect to database 4. Load View Array_push is an array that presses one or more cells into the end of the array of key-value pairs, as above $data[' err_name '] ' Please enter the user name ';

About the CI framework for PHP

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.