Why is the CI framework of PHP endless loops?

Source: Internet
Author: User
Applicationcontrollersaggregsor. php {code...} applicationlibrariesBase. php {code...} the above two parts must have an endless loop. I heard that the ci framework is quite easy to use. I have had an urgent project over the past few days. I used CI for a day and cried. I didn't even write a good log on. I wrote a wrong step... application/controllers/Sor. php.

Class extends Sor extends CI_Controller {public function index ($ page = 'home') {$ this-> load-> library ('base '); // If you use $ this-> load-> libraries ('base'); endless loops $ this-> base-> pageLogin (); print_r (8888 );}}

Application/libraries/Base. php

Class Base {public function _ construct () {$ this-> CI = & get_instance ();} public function pageLogin ($ must = false) {var_dump ($ this-> CI-> session); // If you use $ this-> session, an endless loop is required }}

The above two parts have an infinite loop.

I heard that the ci framework is quite easy to use. in the past few days, there was an urgent project. after using CI for a day, I cried and didn't even write a good log on. if I wrote a mistake, it would take an endless loop, can you give me an error, brother TAT.

Reply content:

Application/controllers/connector Sor. php

Class extends Sor extends CI_Controller {public function index ($ page = 'home') {$ this-> load-> library ('base '); // If you use $ this-> load-> libraries ('base'); endless loops $ this-> base-> pageLogin (); print_r (8888 );}}

Application/libraries/Base. php

Class Base {public function _ construct () {$ this-> CI = & get_instance ();} public function pageLogin ($ must = false) {var_dump ($ this-> CI-> session); // If you use $ this-> session, an endless loop is required }}

The above two parts have an infinite loop.

I heard that the ci framework is quite easy to use. in the past few days, there was an urgent project. after using CI for a day, I cried and didn't even write a good log on. if I wrote a mistake, it would take an endless loop, can you give me an error, brother TAT.

Shouldn't it be at the controller?

Function _ construct (){

   parent::__construct()

Then introduce librari's
}
?

$this->load->library('Base');

When loading the class library, the name must correspond to the class library name!

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.