componentFactory->createMenuItem() * ->setTitle('My Item') // From AbstractControl * ->setClasses('custom-class') // From AbstractControl * ->setDataAttributes([ // From AbstractControl * 'action' => 'do-something' * ]) * ->setHref('/target'); // MenuItem-specific * ``` */ class AbstractControl { /** * CSS classes to apply to the rendered element */ protected string $classes = ''; /** * Title/label text for the control */ protected string $title = ''; /** * HTML data-* attributes for the control * * @var array Key-value pairs (e.g., ['action' => 'save']) */ protected array $dataAttributes = []; public function getClasses(): string { return $this->classes; } public function getTitle(): string { return $this->title; } public function getDataAttributes(): array { return $this->dataAttributes; } public function setClasses(string $classes): static { $this->classes = $classes; return $this; } public function setTitle(string $title): static { $this->title = $title; return $this; } public function setDataAttributes(array $dataAttributes): static { $this->dataAttributes = $dataAttributes; return $this; } }