symfony API

sfContext Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.0 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfContext provides information about the current application context, such as

Method Summary

Method Details

  • (string) getActionName ()

    Retrieve the action name for this context.

    returns The currently executing action name, if one is set, otherwise null.

  • (sfActionStack) getActionStack ()

    Retrieve the ActionStack.

    returns the sfActionStack instance

  • (sfController) getController ()

    Retrieve the controller.

    returns The current sfController implementation instance.

  • (sfView) getCurrentViewInstance ()

    Retrieve the curretn view instance for this context.

    returns The currently view instance, if one is set, otherwise null.

  • (mixed) getDatabaseConnection ()

    Retrieve a database connection from the database manager.


    This is a shortcut to manually getting a connection from an existing
    database implementation instance.

    If the [sf_use_database] setting is off, this will return null.

    returns A Database instance.

    throws sfDatabaseException If the requested database name does not exist.

  • (sfDatabaseManager) getDatabaseManager ()

    Retrieve the database manager.

    returns The current sfDatabaseManager instance.

  • (sfI18N) getI18N ()

    Retrieve the i18n instance

    returns The current sfI18N implementation instance.

  • (sfContext) getInstance ()

    Retrieve the singleton instance of this class.

    returns A sfContext implementation instance.

  • (sfLogger) getLogger ()

    Retrieve the logger.

    returns The current sfLogger implementation instance.

  • (string) getModuleDirectory ()

    Retrieve the module directory for this context.

    returns An absolute filesystem path to the directory of the currently executing module, if one is set, otherwise null.

  • (string) getModuleName ()

    Retrieve the module name for this context.

    returns The currently executing module name, if one is set, otherwise null.

  • (sfRequest) getRequest ()

    Retrieve the request.

    returns The current sfRequest implementation instance.

  • (sfResponse) getResponse ()

    Retrieve the response.

    returns The current sfResponse implementation instance.

  • (sfStorage) getStorage ()

    Retrieve the storage.

    returns The current sfStorage implementation instance.

  • (sfUser) getUser ()

    Retrieve the user.

    returns The current sfUser implementation instance.

  • (sfViewCacheManager) getViewCacheManager ()

    Retrieve the view cache manager

    returns The current sfViewCacheManager implementation instance.

  • hasInstance ()

  • initialize ()

  • removeInstance ()

    Removes current sfContext instance


    This method only exists for testing purpose. Don't use it in your application code.

  • retrieveObjects ()

  • (void.) setResponse ()

    Set the response object.

  • (void) shutdown ()

    Execute the shutdown procedure.