Final Class Yiisoft\FormModel\ParsedProperty
| Inheritance | Yiisoft\FormModel\ParsedProperty |
|---|
Public Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\FormModel\ParsedProperty |
Property Details
Method Details
| public __construct( string $property ): mixed | ||
| $property | string |
The property name or expression |
| throws | InvalidArgumentException |
If the property name contains non-word characters. |
|---|---|---|
public function __construct(string $property)
{
if (!preg_match('/(^|.*\])([\w\.\+\-_]+)(\[.*|$)/u', $property, $matches)) {
throw new InvalidArgumentException('Property name must contain word characters only.');
}
$this->raw = $property;
$this->name = $matches[2];
$this->prefix = $matches[1];
$this->suffix = $matches[3];
$this->path = PathNormalizer::normalize($this->name . $this->suffix);
}
Signup or Login in order to comment.