• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$this->load->view() ???

#6
[eluser]esra[/eluser]
$this->load->view(blog);

Means load the view from the views directory called blog. If blogs was in a subdirectory under views such as views/blogs/, then you would need:

$this->load->view(blog/blog);

Entering the .php file extension is not necessary. CI handles appending the file extension for you using the EXT constant defined in index.php.

$this is the object in scope, load is an alias for the Loader library, and view is a method within the Loader library. Most files in CI are loaded by the Loader library (the notable exception being a Controller). Other examples:

$this->load->library(validation);
$this->load->helper(url);
$this->load->plugin(secureid);

Loader supports loading arrays of files (multiple files) in some cases. In Loader.php, the singular methods load individual files and the plural methods load an array of files.

Read the user guide section about the Loader library. You might want to browse through system/libraries/Loader.php to get an understanding of how Loader loads different file types.


Messages In This Thread
$this->load->view() ??? - by El Forum - 08-23-2007, 08:02 PM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:49 AM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:50 AM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:59 AM
$this->load->view() ??? - by El Forum - 08-30-2007, 06:31 PM
$this->load->view() ??? - by El Forum - 08-31-2007, 03:06 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.