Arrilot\Widgets\Factories\JavascriptFactory::getContainerId PHP Method

getContainerId() public method

Get the current widget container id.
public getContainerId ( ) : string
return string
    public function getContainerId()
    {
        return 'arrilot-widget-container-' . WidgetId::get();
    }

Usage Example

コード例 #1
0
 /**
  * Wrap the given content in a container if it's not an ajax call.
  *
  * @param $content
  *
  * @return string
  */
 protected function wrapContentInContainer($content)
 {
     if (self::$skipWidgetContainer) {
         return $content;
     }
     $container = $this->widget->container();
     if (empty($container['element'])) {
         $container['element'] = 'div';
     }
     return '<' . $container['element'] . ' id="' . $this->javascriptFactory->getContainerId() . '" ' . $container['attributes'] . '>' . $content . '</' . $container['element'] . '>';
 }