Neos\FluidAdaptor\Core\ViewHelper\TemplateVariableContainer::getByPath PHP 메소드

getByPath() 공개 메소드

If the second argument is provided, it must be an array of accessor names which can be used to extract each value in the dotted path.
public getByPath ( string $path, array $accessors = [] ) : mixed
$path string
$accessors array
리턴 mixed
    public function getByPath($path, array $accessors = [])
    {
        $propertyPathSegments = explode('.', $path);
        $subject = $this->variables;
        foreach ($propertyPathSegments as $propertyName) {
            if ($subject === null) {
                break;
            }
            try {
                $subject = ObjectAccess::getProperty($subject, $propertyName);
            } catch (PropertyNotAccessibleException $exception) {
                $subject = null;
            }
            if ($subject instanceof TemplateObjectAccessInterface) {
                $subject = $subject->objectAccess();
            }
        }
        if ($subject === null) {
            $subject = $this->getBooleanValue($path);
        }
        return $subject;
    }
TemplateVariableContainer