Ejemplo n.º 1
0
 /**
  * Content plugins callback.
  *
  * @param ContentEvent $event
  */
 public function onContentPlugins(ContentEvent $event)
 {
     $content = preg_replace_callback(self::PLUGIN_CODE, function ($matches) use($event) {
         $options = isset($matches[2]) ? json_decode($matches[2], true) : [];
         if ($callback = $event->getPlugin($matches[1])) {
             return call_user_func($callback, (array) $options);
         }
     }, $event->getContent());
     $event->setContent($content);
 }