Symfony Framework
sf_symfony_lib_dirThe real path to the framework’s lib directory
(/usr/share/php/symfony/symfony12/lib)
Project Structure and Layout
sf_root_dirThe path to the project root
(/var/www/project_name)
sf_apps_dirThe path to the project’s apps folder
(/var/www/project_name/apps)
sf_lib_dirThe path to the project’s lib folder
(/var/www/project_name/lib)
sf_log_dirThe path to the project’s log folder
(/var/www/project_name/log)
sf_data_dirThe path to the project’s data folder
(/var/www/project_name/data)
sf_config_dirThe path to the project’s config folder
(/var/www/project_name/config)
sf_test_dirThe path to the project’s test folder
(/var/www/project_name/test)
sf_doc_dirThe path to the project’s doc folder
(/var/www/project_name/doc)
sf_plugins_dirThe path to the project’s plugins folder
(/var/www/project_name/plugins)
sf_cache_dirThe path to the project’s plugins folder
(/var/www/project_name/cache)
sf_web_dirThe path to the project’s plugins folder
(/var/www/project_name/web)
sf_upload_dirThe path to the project’s upload folder
(/var/www/project_name/web/uploads)
Application Information
sf_appThe current application
(backend)
sf_environmentThe current environment
(dev)
sf_debugWhether debugging is enabled
(1)
Application Structure and Layout
sf_app_dirThe path to the current application
(/var/www/project_name/apps/backend)
sf_app_config_dirThe path to the current application’s config directory
(/var/www/project_name/apps/backend/config)
sf_app_lib_dirThe path to the current application’s lib directory
(/var/www/project_name/apps/backend/lib)
sf_app_module_dirThe path to the current application’s module directory
(/var/www/project_name/apps/backend/modules)
sf_app_template_dirThe path to the current application’s template directory
(/var/www/project_name/apps/backend/templates)
sf_app_i18n_dirThe path to the current application’s i18n directory
(/var/www/project_name/apps/backend/i18n)
Cache Structure and Layout
sf_app_base_cache_dirThe path to the current application’s directory in the cache
(/var/www/project_name/cache/backend)
sf_app_cache_dirThe path to the current application’s directory in the cache by current environment
(/var/www/project_name/cache/backend/dev)
sf_template_cache_dirThe path to the current application’s templates directory in the cache by current environment
(/var/www/project_name/cache/backend/dev/template)
sf_i18n_cache_dirThe path to the current application’s i18n directory in the cache by current environment
(/var/www/project_name/cache/backend/dev/i18n)
sf_config_cache_dirThe path to the current application’s config directory in the cache by current environment
(/var/www/project_name/cache/backend/dev/config)
sf_test_cache_dirThe path to the current application’s test directory in the cache by current environment
(/var/www/project_name/cache/backend/dev/test)
sf_module_cache_dirThe path to the current application’s modules directory in the cache by current environment
(/var/www/project_name/cache/backend/dev/modules)
Application Settings
You can access any value in settings.yml by prepending “sf_” to the value.
sf_error_404_moduleThe module that contains the 404 action (default)
sf_error_404_actionThe action that displays the 404 error (error404)
sf_logging_enabledBoolean for whether logging is currently enabled (1)
sf_escaping_strategyWhether the sfView class is using the Escaping Strategy (1)
sf_no_script_nameWhether the application is requiring the script name. (1)
sf_csrf_secretThe CSRF secret (UniqueSecret)
Also:
You can grab some information from the current context (usually in templates, but should work well enough in actions – I’d be very cautious about using these in models):
sfContext::getInstance()->getActionName();The name of the current action. Can also be called by $this->getActionName() in templates.
(my_awesome_action)
sfContext::getInstance()->getModuleName();The name of the current module. Can also be called by $this->getModuleName() in templates.
(my_awesome_module)
sfContext::getInstance()->getModuleDirectory();Retirado daqui.The path to the current module’s directory
(/var/www/project_name/apps/backend/modules/my_awesome_module)
Nenhum comentário:
Postar um comentário