本文整理汇总了PHP中Mautic\CoreBundle\Helper\InputHelper::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP InputHelper::raw方法的具体用法?PHP InputHelper::raw怎么用?PHP InputHelper::raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mautic\CoreBundle\Helper\InputHelper
的用法示例。
在下文中一共展示了InputHelper::raw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: previewAction
/**
* Gives a preview of the form
*
* @param int $id
*
* @return Response
* @throws \Exception
* @throws \Mautic\CoreBundle\Exception\FileNotFoundException
*/
public function previewAction($id = 0)
{
$objectId = empty($id) ? InputHelper::int($this->request->get('id')) : $id;
$css = InputHelper::raw($this->request->get('css'));
$model = $this->factory->getModel('form.form');
$form = $model->getEntity($objectId);
$customStylesheets = !empty($css) ? explode(',', $css) : array();
if ($form === null || !$form->isPublished()) {
throw $this->createNotFoundException($this->factory->getTranslator()->trans('mautic.core.url.error.404'));
} else {
$html = $model->getContent($form);
$model->populateValuesWithGetParameters($form, $html);
$viewParams = array('content' => $html, 'stylesheets' => $customStylesheets, 'name' => $form->getName());
$template = $form->getTemplate();
if (!empty($template)) {
$theme = $this->factory->getTheme($template);
if ($theme->getTheme() != $template) {
$config = $theme->getConfig();
if (in_array('form', $config['features'])) {
$template = $theme->getTheme();
} else {
$template = null;
}
}
}
}
$viewParams['template'] = $template;
return $this->render('MauticFormBundle::form.html.php', $viewParams);
}