Initial commit

This commit is contained in:
isUnknown 2025-10-03 07:46:23 +02:00
commit efa5624dab
687 changed files with 162710 additions and 0 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace Kirby\Form\Mixin;
use Kirby\Toolkit\Str;
/**
* @package Kirby Form
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://opensource.org/licenses/MIT
*/
trait Label
{
/**
* The field label can be set as string or associative array with translations
*/
protected string|null $label;
public function label(): string|null
{
return $this->stringTemplate(
$this->label ?? Str::ucfirst($this->name())
);
}
protected function setLabel(array|string|null $label = null): void
{
$this->label = $this->i18n($label);
}
}