CI_Loader::file()

file($path[, $return = FALSE])

Parameters:
  • $path (string) – File path
  • $return (bool) – Whether to return the loaded file
Returns:

File contents if $return is set to TRUE, otherwise CI_Loader instance (method chaining)

Return type:

mixed

This is a generic file loading method. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to boolean TRUE it will instead return the data as a string.

doc_CodeIgniter
2016-10-15 16:31:43
Comments
Leave a Comment

Please login to continue.