本文整理汇总了PHP中FormHelper::addScriptsAndStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHelper::addScriptsAndStyles方法的具体用法?PHP FormHelper::addScriptsAndStyles怎么用?PHP FormHelper::addScriptsAndStyles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHelper
的用法示例。
在下文中一共展示了FormHelper::addScriptsAndStyles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Mandatory execute method...
*
* @param block_BlockContext $context
* @param block_BlockRequest $request
*/
public function execute($context, $request)
{
FormHelper::addScriptsAndStyles($context);
$form = $this->getParameter('form');
$this->setTemplateName('markup/' . $form->getMarkup() . '/Form');
$this->setAttribute('form', $form);
$contents = array();
form_FormService::getInstance()->buildContentsFromRequest($form->getDocumentNode()->getChildren(), $contents, $request, $form);
$this->setAttribute('elements', $contents);
if ($this->hasParameter('errors')) {
$this->setAttribute('errors', $this->getParameter('errors'));
}
$this->setAttribute('selfUrl', $_SERVER['REQUEST_URI']);
if ($request->getParameter(form_FormConstants::BACK_URL_PARAMETER)) {
$backUrl = $request->getParameter(form_FormConstants::BACK_URL_PARAMETER);
} else {
if (isset($_SERVER['HTTP_REFERER'])) {
$backUrl = $_SERVER['HTTP_REFERER'];
} else {
$backUrl = website_WebsiteModuleService::getInstance()->getCurrentWebsite()->getUrl();
}
}
$this->setAttribute("receiverLabels", $this->getParameter("receiverLabels"));
$this->setAttribute('requestParameters', $request->getParameters());
$this->setAttribute('backUrl', $backUrl);
$this->setAttribute('useCaptcha', $form->getDocumentService()->hasToUseCaptcha($form));
$this->setAttribute('jQueryConditionalElement', $form->getDocumentService()->getJQueryForConditionalElementsOf($form));
}
示例2: getInputView
/**
* @param form_persistentdocument_form $form
* @param f_mvc_Request $request
* @return String
*/
protected function getInputView($form, $request)
{
$context = $this->getContext();
FormHelper::addScriptsAndStyles($context);
$previousModuleName = FormHelper::getModuleName();
$moduleName = $this->getModuleName();
FormHelper::setModuleName($moduleName);
$contents = $this->getContentsFromRequest($form->getDocumentNode()->getChildren(), $request, $form);
FormHelper::setModuleName($previousModuleName);
$request->setAttribute('elements', $contents);
$request->setAttribute('selfUrl', $_SERVER['REQUEST_URI']);
if ($request->getParameter('backUrl')) {
$backUrl = $request->getParameter('backUrl');
} else {
if (isset($_SERVER['HTTP_REFERER'])) {
$backUrl = $_SERVER['HTTP_REFERER'];
} else {
$backUrl = website_WebsiteModuleService::getInstance()->getCurrentWebsite()->getUrl();
}
}
$request->setAttribute('requestParameters', $request->getParameters());
$request->setAttribute('backUrl', $backUrl);
$request->setAttribute('useCaptcha', $form->getDocumentService()->hasToUseCaptcha($form));
$request->setAttribute('jQueryConditionalElement', $form->getDocumentService()->getJQueryForConditionalElementsOf($form));
return $this->getInputTemplateByFullName($form);
}
示例3: execute
/**
* @param website_BlockActionRequest $request
* @param website_BlockActionResponse $response
*/
public function execute($request, $response)
{
FormHelper::addScriptsAndStyles($this->getPage());
}