Class Controller
A default controller class to be extended
Located in /class.controller.php (line 24)
Stores view data that is passed from the Controller to the View
Stores whether the current request will result in a 404 error
Stores the name of the file file that will be loaded at the end of the request
Constructor. Currently does not do anything.
This specialized method does two things: it attempts to set the HTTP status code, 400 by default, to inform the web browser that there was an error, and second, echoes the supplied error message to the browser, which could be a simple string or a JSON object.
- string $sError: The error message to output
- int $iResponseCode: Optional; The response code to send to the browser. Default: 400
Retrieves any flash message stored in the flash session variable, if any. See the SetFlash() method.
Every controller must have an index() method defined for default requests to the controller that do not define a method. Since it is a requirement for this method to exist, it is defined in the parent controller class.
Returns the internal 404 status to determine if a 404 error flag was triggered
Determines whether or not the current HTTP request came via AJAX.
This method redirects the browser to the specified URL. The second argument controls whether or not the 301 HTTP response code is used to signal a permanent redirect. Using this response code enable the user to hit refresh afterwards without resubmitting any form data from the original request.
If headers have already been sent to the browser, this method will return false and will not call the redirect. Otherwise this method will always return true.
- string $sURL: The URL to redirect to
- bool $bPermanentRedirect: Optional; True to signal a permanent redirect, false to not set the HTTP response code. Default: true
Sets or clears the internal 404 error status flag.
- bool $bIs404Error: True to trigger a 404 error, false to clear the 404 flag. Default: true
Sets a data variable that can be used by the view file. Supplying the name and value of the variable, before loading the view file, these variables will be extracted and available in the view file for processing and/or display.
If the supplied variable already exists, it will be overwritten.
- string $sName: The name of the variable to set
- mixed $sValue: The value of the variable to set
Sets a session variable called flash with the supplied message. This can be used on a redirect to display a success message (in conjunction with the RedirectTo() method).
If a flash message is already set, it will be overwritten on subsequent calls.
- string $sMessage: The message to set in the flash session variable
Sets the HTTP status code header. This method will only work if no output or headers have already been sent.
- int $iCode: The HTTP status code
Sets the view file that should be loaded at the end of the request. This method does not check to ensure that the file specified actually exists. It is up to the code that loads the view file to do this (normally the Dispatcher class).
- string $sView: The file name of the view file that should be loaded.
Documentation generated on Thu, 25 Feb 2010 15:59:39 -0500 by phpDocumentor 1.4.3

