Codeigniter 2 Unterschied zwischen index und __construct und was im __construct

Wann wird __construct genannt und Wann ist index genannt? Und gibt es irgendwelche anderen Unterschiede?

Und was im __construct? Was ist die beste Praxis, sollte ich $this->laden Anrufe... ? was sonst?

class Site extends CI_Controller {

      public function __construct() {

          parent::__construct();
          echo 'Hello World2';

     }

     public function index() {

          echo 'Hello World1';

     }
}
InformationsquelleAutor VoX | 2013-05-22
Schreibe einen Kommentar