Xpressengine\DynamicField\AbstractSkin::search PHP Method

    public function search(array $args)
    {
        if ($this->config->get('searchable') !== true) {
            return '';
        }
        list($data, $key) = $this->filter($args);
        $viewFactory = $this->handler->getViewFactory();
        return $viewFactory->make($this->getViewPath('search'), ['config' => $this->config, 'data' => array_merge($data, $this->mergeData), 'key' => $key])->render();
    }

Usage Example

Esempio n. 1
0
 /**
  * 리스트에서 검색할 때 검색 form 에 사용될 html 코드 반환
  * return html tag string
  *
  * @param array $args      arguments
  * @return string
  */
 public function search(array $args)
 {
     $category = Category::find($this->config->get('categoryId'));
     $item = null;
     if (isset($args[$this->config->get('id') . 'ItemId'])) {
         $item = CategoryItem::find($args[$this->config->get('id') . 'ItemId']);
     }
     $this->addMergeData(['categoryItems' => $category->items, 'categoryItem' => $item]);
     return parent::search($args);
 }