Comments: on this page. Click to read or post your own.
Director is responsible for processing URLs, and providing environment information.
The most important part of director is Director::direct(), which is passed a URL and will execute the appropriate controller.
Director also has a number of static methods that provide information about the environment, such as Director::set_environment_type().
Located in /sapphire/core/control/Director.php (line 14)
Sets the site mode (if it is the public site or the cms), and runs registered modules.
Returns the Absolute URL of the site root.
Returns the Absolute URL of the site root, embedding the current basic-auth credentials into the URL.
Turns the given URL into an absolute URL.
Add URL matching rules to the Director.
The director is responsible for turning URLs into Controller objects. It does thi
Allows a module to register with the director to be run once
the controller is instantiated. The optional 'mode' parameter can be either 'site' or 'cms', as those are the two values currently set by controllers. The callback function will be run at the initialization of the relevant controller.
Returns the root filesystem folder for the site.
It will be automatically calculated unless it is overridden with setBaseFolder().
Returns the root URL for the site.
It will be automatically calculated unless it is overridden with setBaseURL().
Returns the dataobject of the current page.
This will only return a value if you are looking at a SiteTree page
Process the given URL, creating the appropriate controller and executing it.
Request processing is handled as folows:
Returns true if the given file exists.
Force the site to run on SSL. To use, call from _config.php.
For example:
Force a redirect to a domain starting with "www."
Given a filesystem reference relative to the site root, return the full file-system path.
Can also be checked with Director::isDev(), Director::isTest(), and Director::isLive().
Returns the current HTTP status code
Handle an HTTP request, defined with a HTTPRequest object.
Return a URL from this user's navigation history.
This function will return true if the site is in a development environment.
For information about environment types, see Director::set_environment_type().
This function will return true if the site is in a test environment.
For information about environment types, see Director::set_environment_type().
Returns true if a given path is absolute. Works under both *nix and windows systems
Checks if a given URL is absolute (e.g. starts with 'http://' etc.).
Checks if the current HTTP-Request is an "Ajax-Request" by checking for a custom header set by prototype.js or wether a manually set request-parameter 'ajax' is present.
Returns true if this script is being run from the command line rather than the webserver.
Checks if a given URL is relative by checking is_absolute_url().
Checks if the given URL is belonging to this "site", as defined by makeRelative() and absoluteBaseUrl().
Useful to check before redirecting based on a URL from user submissions through $_GET or $_POST, and avoid phishing attacks by redirecting to an attackers server.
Returns a URL to composed of the given segments - usually controller, action, parameter
Turns an absolute URL or folder into one that's relative to the root of the site.
This is useful when turning a URL into a filesystem reference, or vice versa.
Returns the part of the URL, 'http://www.mysite.com'.
Redirect to another page.
Tests whether a redirection has been requested.
Sets the root folder for the website.
If the site isn't accessible from the folder you provide, weird things will happen.
Sets the root URL for the website.
If the site isn't accessible from the URL you provide, weird things will happen.
Specify HTTP_HOST values that are development environments.
For information about environment types, see Director::set_environment_type().
Set the environment type of the current site.
Typically, a SilverStripe site have a number of environments:
To help with this, Sapphire support the notion of an environment type. The environment type can be dev, test, or live.
You can set it explicitly with Director::set_environment_tpye(). Or you can use Director::set_dev_servers() and Director::set_test_servers() to set it implicitly, based on the value of $_SERVER['HTTP_HOST']. If the HTTP_HOST value is one of the servers listed, then the environment type will be test or dev. Otherwise, the environment type will be live.
Dev mode can also be forced by putting ?isDev=1 in your URL, which will ask you to log in and then push the site into dev mode for the remainder of the session. Putting ?isDev=0 onto the URL can turn it back. Generally speaking, these methods will be called from your _config.php file.
Once the environment type is set, it can be checked with Director::isDev(), Director::isTest(), and Director::isLive().
Sets the site mode (if it is the public site or the cms), and runs registered modules.
Sets the HTTP status code
Specify HTTP_HOST values that are test environments.
For information about environment types, see Director::set_environment_type().
Test a URL request, returning a response object.
This method is the counterpart of Director::direct() that is used in functional testing. It will execute the URL given,
Returns the urlParam with the given name
Returns an array of urlParams
Documentation generated on Mon, 23 Mar 2009 06:49:08 +1300 by phpDocumentor 1.3.2