registerArgument('id', 'int', 'Category id', true); $this->registerArgument('categories', 'array', 'List of categories', false, []); } /** * @return string */ public function render(): string { return (isset($this->arguments['categories']) && is_array($this->arguments['categories']) && in_array($this->arguments['id'], $this->arguments['categories'])) ? 'checked="checked"' : ''; } }