Xpressengine\Widget\WidgetParser::parseWidget PHP Method

parseWidget() protected method

주어진 하나의 위젯 코드를 분석하고, 위젯을 출력한다.
protected parseWidget ( array $matches ) : mixed | string
$matches array 위젯 코드
return mixed | string
    protected function parseWidget($matches)
    {
        $widgetHandler = $this->widgetHandler;
        try {
            $widgetXmlString = $matches[0];
            $inputs = $this->parseCode($widgetXmlString);
            $widgetId = array_get($inputs, '@attributes.id');
            $retString = $widgetHandler->render($widgetId, $inputs);
            if ($retString !== null && !empty($retString)) {
                return $retString;
            }
        } catch (\Exception $e) {
            return '';
        }
        return '';
    }