symfony API

sfContext Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.0 API OpenSearch

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 () Browse code

    Retrieve the action name for this context.

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

  • (sfActionStack) getActionStack () Browse code

    Retrieve the ActionStack.

    returns the sfActionStack instance

  • (sfController) getController () Browse code

    Retrieve the controller.

    returns The current sfController implementation instance.

  • (sfView) getCurrentViewInstance () Browse code

    Retrieve the curretn view instance for this context.

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

  • (mixed) getDatabaseConnection () Browse code

    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 () Browse code

    Retrieve the database manager.

    returns The current sfDatabaseManager instance.

  • (sfI18N) getI18N () Browse code

    Retrieve the i18n instance

    returns The current sfI18N implementation instance.

  • (sfContext) getInstance () Browse code

    Retrieve the singleton instance of this class.

    returns A sfContext implementation instance.

  • (sfLogger) getLogger () Browse code

    Retrieve the logger.

    returns The current sfLogger implementation instance.

  • (string) getModuleDirectory () Browse code

    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 () Browse code

    Retrieve the module name for this context.

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

  • (sfRequest) getRequest () Browse code

    Retrieve the request.

    returns The current sfRequest implementation instance.

  • (sfResponse) getResponse () Browse code

    Retrieve the response.

    returns The current sfResponse implementation instance.

  • (sfStorage) getStorage () Browse code

    Retrieve the storage.

    returns The current sfStorage implementation instance.

  • (sfUser) getUser () Browse code

    Retrieve the user.

    returns The current sfUser implementation instance.

  • (sfViewCacheManager) getViewCacheManager () Browse code

    Retrieve the view cache manager

    returns The current sfViewCacheManager implementation instance.

  • hasInstance () Browse code

  • initialize () Browse code

  • removeInstance () Browse code

    Removes current sfContext instance


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

  • retrieveObjects () Browse code

  • (void.) setResponse () Browse code

    Set the response object.

  • (void) shutdown () Browse code

    Execute the shutdown procedure.