protected function component()
    {

        $function = function ($params) {
            if (($classname = $this->validate($params)) === false) {
                return '';
            }
            if (($object = $this->getInstance($classname, $params)) === false) {
                return '';
            }
            $ajax = $this->isAjax();
            $args = func_get_args();
            if ((int) $object->getAttribute('disabled') && !$ajax && !isset($args[1])) {
                return '';
            }

            if (isset($args[1]) && $args[1] == true) {
                return $object->setView('antares/ui-components::admin.partials._base');
            }
            return ($ajax) ? $object->render() : $object->show();
        };
        return new Twig_SimpleFunction(
                'component', $function
        );
    }