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


PHP InputHelper::html方法代码示例

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


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

示例1: setBuilderContentAction

 /**
  * @param Request $request
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 protected function setBuilderContentAction(Request $request)
 {
     $dataArray = array('success' => 0);
     $entityId = InputHelper::clean($request->request->get('entity'));
     $session = $this->factory->getSession();
     if (!empty($entityId)) {
         $sessionVar = 'mautic.emailbuilder.' . $entityId . '.content';
         // Check for an array of slots
         $slots = InputHelper::_($request->request->get('slots', array(), true), 'html');
         $content = $session->get($sessionVar, array());
         if (!is_array($content)) {
             $content = array();
         }
         if (!empty($slots)) {
             // Builder was closed so save each content
             foreach ($slots as $slot => $newContent) {
                 $content[$slot] = $newContent;
             }
             $session->set($sessionVar, $content);
             $dataArray['success'] = 1;
         } else {
             // Check for a single slot
             $newContent = InputHelper::html($request->request->get('content'));
             $slot = InputHelper::clean($request->request->get('slot'));
             if (!empty($slot)) {
                 $content[$slot] = $newContent;
                 $session->set($sessionVar, $content);
                 $dataArray['success'] = 1;
             }
         }
     }
     return $this->sendJsonResponse($dataArray);
 }
开发者ID:HomeRefill,项目名称:mautic,代码行数:38,代码来源:AjaxController.php

示例2: addNotification

 /**
  * Write a notification.
  *
  * @param string    $message   Message of the notification
  * @param string    $type      Optional $type to ID the source of the notification
  * @param bool|true $isRead    Add unread indicator
  * @param string    $header    Header for message
  * @param string    $iconClass Font Awesome CSS class for the icon (e.g. fa-eye)
  * @param \DateTime $datetime  Date the item was created
  * @param User|null $user      User object; defaults to current user
  */
 public function addNotification($message, $type = null, $isRead = false, $header = null, $iconClass = null, \DateTime $datetime = null, User $user = null)
 {
     if ($user === null) {
         $user = $this->userHelper->getUser();
     }
     if ($user === null || !$user->getId()) {
         //ensure notifications aren't written for non users
         return;
     }
     $notification = new Notification();
     $notification->setType($type);
     $notification->setIsRead($isRead);
     $notification->setHeader(EmojiHelper::toHtml(InputHelper::html($header)));
     $notification->setMessage(EmojiHelper::toHtml(InputHelper::html($message)));
     $notification->setIconClass($iconClass);
     $notification->setUser($user);
     if ($datetime == null) {
         $datetime = new \DateTime();
     }
     $notification->setDateAdded($datetime);
     $this->saveEntity($notification);
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:33,代码来源:NotificationModel.php


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