本文整理汇总了PHP中sfContext::getResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP sfContext::getResponse方法的具体用法?PHP sfContext::getResponse怎么用?PHP sfContext::getResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfContext
的用法示例。
在下文中一共展示了sfContext::getResponse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initializes this Filter.
*
* @param sfContext $context The current application context
* @param array $parameters An associative array of initialization parameters
*
* @return boolean true
*/
public function initialize($context, $parameters = array())
{
$this->request = $context->getRequest();
$this->response = $context->getResponse();
$this->user = $context->getUser();
return parent::initialize($context, $parameters);
}
示例2: initialize
/**
* Initializes this component.
*
* @param sfContext $context The current application context
*
* @return boolean true, if initialization completes successfully, otherwise false
*/
public function initialize($context)
{
$this->context = $context;
$this->varHolder = new sfParameterHolder();
$this->request = $context->getRequest();
$this->response = $context->getResponse();
$this->requestParameterHolder = $this->request->getParameterHolder();
return true;
}
示例3: initialize
/**
* Initializes this component.
*
* @param sfContext $context The current application context.
* @param string $moduleName The module name.
* @param string $actionName The action name.
*
* @return boolean true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $moduleName, $actionName)
{
$this->moduleName = $moduleName;
$this->actionName = $actionName;
$this->context = $context;
$this->dispatcher = $context->getEventDispatcher();
$this->varHolder = new sfParameterHolder();
$this->request = $context->getRequest();
$this->response = $context->getResponse();
$this->requestParameterHolder = $this->request->getParameterHolder();
}
示例4: _loadEditorAssets
/**
* Loads all of the js/css necessary to support the inline editor
*
* @param sfWebResponse $response
* @return void
*/
protected function _loadEditorAssets(sfContext $context)
{
$context->getEventDispatcher()->notify(new sfEvent($context->getResponse(), 'editable_content.load_editor_assets'));
$response = $context->getResponse();
$pluginWebRoot = sfConfig::get('app_editable_content_assets_web_root', '/ioEditableContentPlugin');
// JQuery
if (true === sfConfig::get('app_editable_content_load_jquery')) {
$response->addJavascript(sprintf('%s/js/jquery-1.4.3.min.js', $pluginWebRoot), 'last');
}
// JQuery ui (just core and widget)
if (true === sfConfig::get('app_editable_content_load_jquery_ui')) {
$response->addJavascript(sprintf('%s/js/jquery-ui-core-widget.min.js', $pluginWebRoot), 'last');
}
// JQuery metadata
if (true === sfConfig::get('app_editable_content_load_jquery_metadata')) {
$response->addJavascript(sprintf('%s/js/jquery.metadata.js', $pluginWebRoot), 'last');
}
// JQuery form
if (true === sfConfig::get('app_editable_content_load_jquery_form')) {
$response->addJavascript(sprintf('%s/js/jquery.form.js', $pluginWebRoot), 'last');
}
// JQuery blockUI
if (true === sfConfig::get('app_editable_content_load_jquery_blockui')) {
$response->addJavascript(sprintf('%s/js/jquery.blockUI.js', $pluginWebRoot), 'last');
}
// Fancybox
if (true === sfConfig::get('app_editable_content_load_fancybox')) {
$response->addJavascript(sprintf('%s/fancybox/jquery.fancybox-1.3.4.js', $pluginWebRoot), 'last');
$response->addStylesheet(sprintf('%s/fancybox/jquery.fancybox-1.3.4.css', $pluginWebRoot), 'last');
}
// The admin javascript file is handled by symfony
$response->addJavascript(sprintf('%s/js/ioEditableContentList.js', $pluginWebRoot), 'last');
$response->addJavascript(sprintf('%s/js/ioEditableContent.js', $pluginWebRoot), 'last');
$response->addJavascript(sprintf('%s/js/ioContentEditor.js', $pluginWebRoot), 'last');
$response->addJavascript($context->getController()->genUrl('@editable_content_admin_js'), 'last');
// The admin css file is handled by symfony
$response->addStylesheet($context->getController()->genUrl('@editable_content_admin_css'), 'first');
}
开发者ID:kimbrelas,项目名称:ioEditableContentPlugin,代码行数:44,代码来源:ioEditableContentPluginConfiguration.class.php
示例5: initialize
/**
* Initializes this view.
*
* @param sfContext $context The current application context
* @param string $moduleName The module name for this view
* @param string $actionName The action name for this view
* @param string $viewName The view name
*
* @return bool true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $moduleName, $actionName, $viewName)
{
$this->moduleName = $moduleName;
$this->actionName = $actionName;
$this->viewName = $viewName;
$this->context = $context;
$this->dispatcher = $context->getEventDispatcher();
sfOutputEscaper::markClassesAsSafe(array('sfForm', 'sfModelGeneratorHelper'));
$this->attributeHolder = $this->initializeAttributeHolder();
$this->parameterHolder = new sfParameterHolder();
$this->parameterHolder->add(sfConfig::get('mod_' . strtolower($moduleName) . '_view_param', array()));
$request = $context->getRequest();
$format = $request->getRequestFormat();
if (null !== $format) {
if ('html' != $format) {
$this->setExtension('.' . $format . $this->getExtension());
}
if ($mimeType = $request->getMimeType($format)) {
$this->context->getResponse()->setContentType($mimeType);
if ('html' != $format) {
$this->setDecorator(false);
}
}
}
$this->dispatcher->notify(new sfEvent($this, 'view.configure_format', array('format' => $format, 'response' => $context->getResponse(), 'request' => $context->getRequest())));
// include view configuration
$this->configure();
return true;
}
示例6: initialize
/**
* Initializes this view.
*
* @param sfContext $context The current application context
* @param string $moduleName The module name for this view
* @param string $actionName The action name for this view
* @param string $viewName The view name
*
* @return bool true, if initialization completes successfully, otherwise false
*/
public function initialize($context, $moduleName, $actionName, $viewName)
{
$this->moduleName = $moduleName;
$this->actionName = $actionName;
$this->viewName = $viewName;
$this->context = $context;
$this->dispatcher = $context->getEventDispatcher();
if (sfConfig::get('sf_logging_enabled')) {
$this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Initialize view for "%s/%s"', $moduleName, $actionName))));
}
sfOutputEscaper::markClassAsSafe('sfForm');
$this->attributeHolder = $this->initializeAttributeHolder();
$this->parameterHolder = new sfParameterHolder();
$this->parameterHolder->add(sfConfig::get('mod_' . strtolower($moduleName) . '_view_param', array()));
$request = $context->getRequest();
if (!is_null($format = $request->getRequestFormat())) {
if ('html' != $format) {
$this->setExtension('.' . $format . $this->getExtension());
}
if ($mimeType = $request->getMimeType($format)) {
$this->context->getResponse()->setContentType($mimeType);
$this->setDecorator(false);
}
$this->dispatcher->notify(new sfEvent($this, 'view.configure_format', array('format' => $format, 'response' => $context->getResponse(), 'request' => $context->getRequest())));
}
// include view configuration
$this->configure();
return true;
}