Final Class Yiisoft\FormModel\ParsedProperty
| Inheritance | Yiisoft\ |
|---|
Public Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
Property Details
Method Details
| public mixed __construct ( string $property ) | ||
| $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);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.