当前位置: 首页>>代码示例>>PHP>>正文


PHP InputHelper::string方法代码示例

本文整理汇总了PHP中Mautic\CoreBundle\Helper\InputHelper::string方法的典型用法代码示例。如果您正苦于以下问题:PHP InputHelper::string方法的具体用法?PHP InputHelper::string怎么用?PHP InputHelper::string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mautic\CoreBundle\Helper\InputHelper的用法示例。


在下文中一共展示了InputHelper::string方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetchRemoteFilesAction

 /**
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 protected function fetchRemoteFilesAction(Request $request)
 {
     $provider = InputHelper::string($request->request->get('provider'));
     $path = InputHelper::string($request->request->get('path', ''));
     $dispatcher = $this->factory->getDispatcher();
     $name = AssetEvents::ASSET_ON_REMOTE_BROWSE;
     if (!$dispatcher->hasListeners($name)) {
         return $this->sendJsonResponse(array('success' => 0));
     }
     /** @var \Mautic\PluginBundle\Helper\IntegrationHelper $integrationHelper */
     $integrationHelper = $this->factory->getHelper('integration');
     /** @var \Mautic\PluginBundle\Integration\AbstractIntegration $integration */
     $integration = $integrationHelper->getIntegrationObject($provider);
     $event = new RemoteAssetBrowseEvent($integration);
     $dispatcher->dispatch($name, $event);
     if (!($adapter = $event->getAdapter())) {
         return $this->sendJsonResponse(array('success' => 0));
     }
     $connector = new Filesystem($adapter);
     $output = $this->renderView('MauticAssetBundle:Remote:list.html.php', array('connector' => $connector, 'integration' => $integration, 'items' => $connector->listKeys($path)));
     return $this->sendJsonResponse(array('success' => 1, 'output' => $output));
 }
开发者ID:Jandersolutions,项目名称:mautic,代码行数:26,代码来源:AjaxController.php

示例2: 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::string($this->request->get('css'));
     $model = $this->getModel('form.form');
     $form = $model->getEntity($objectId);
     $customStylesheets = !empty($css) ? explode(',', $css) : [];
     $template = null;
     if ($form === null || !$form->isPublished()) {
         $this->notFound();
     } 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;
     if (!empty($template)) {
         $logicalName = $this->factory->getHelper('theme')->checkForTwigTemplate(':' . $template . ':form.html.php');
         $assetsHelper = $this->factory->getHelper('template.assets');
         $analytics = $this->factory->getHelper('template.analytics')->getCode();
         if (!empty($customStylesheets)) {
             foreach ($customStylesheets as $css) {
                 $assetsHelper->addStylesheet($css);
             }
         }
         $this->factory->getHelper('template.slots')->set('pageTitle', $form->getName());
         if (!empty($analytics)) {
             $assetsHelper->addCustomDeclaration($analytics);
         }
         return $this->render($logicalName, $viewParams);
     }
     return $this->render('MauticFormBundle::form.html.php', $viewParams);
 }
开发者ID:Yame-,项目名称:mautic,代码行数:54,代码来源:PublicController.php


注:本文中的Mautic\CoreBundle\Helper\InputHelper::string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。