getMethodParams example



        // Fill in any public properties that were passed in         // but only ones that are in the $pulibcProperties array.         $instance = $instance->fill($publicParams);

        // If there are any protected/private properties, we need to         // send them to the mount() method.         if (method_exists($instance, 'mount')) {
            // if any $params have keys that match the name of an argument in the             // mount method, pass those variables to the method.             $mountParams = $this->getMethodParams($instance, 'mount', $params);
            $instance->mount(...$mountParams);
        }

        return $instance->{$method}();
    }

    /** * Returns the values from $params that match the parameters * for a method, in the order they are defined. This allows * them to be passed directly into the method. */
    


        return strtolower($this->httpHost) === strtolower($hostname);
    }

    private function processArrayCallableSyntax(string $from, array $to): string
    {
        // [classname, method]         // eg, [Home::class, 'index']         if (is_callable($to, true, $callableName)) {
            // If the route has placeholders, add params automatically.             $params = $this->getMethodParams($from);

            return '\\' . $callableName . $params;
        }

        // [[classname, method], params]         // eg, [[Home::class, 'index'], '$1/$2']         if (
            isset($to[0]$to[1])
            && is_callable($to[0], true, $callableName)
            && is_string($to[1])
        ) {
            
Home | Imprint | This part of the site doesn't use cookies.