protected function loadJsonParameters()
    {
        $reflectionObject = new \ReflectionObject($this);
        $componentFile    = $reflectionObject->getFileName();
        $parameterFile    = dirname($componentFile).DIRECTORY_SEPARATOR.pathinfo(
                $componentFile,
                PATHINFO_FILENAME
            ).'.json';
        if (is_readable($parameterFile)) {
            $jsonParameters = file_get_contents($parameterFile);
            if (strlen($jsonParameters)) {
                $jsonParameterObj = @json_decode($jsonParameters);
                if ($jsonParameterObj && is_object($jsonParameterObj)) {
                    foreach ($jsonParameterObj as $name => $value) {
                        $this->setParameter($name, $value);
                    }
                }
            }
        }
    }
protected function loadJsonParameters()
    {
        $reflectionObject = new \ReflectionObject($this);
        $componentFile    = $reflectionObject->getFileName();
        $parameterFile    = dirname($componentFile).DIRECTORY_SEPARATOR.pathinfo(
                $componentFile,
                PATHINFO_FILENAME
            ).'.json';
        if (is_readable($parameterFile)) {
            $jsonParameters = file_get_contents($parameterFile);
            if (strlen($jsonParameters)) {
                $jsonParameterObj = @json_decode($jsonParameters);
                if ($jsonParameterObj && is_object($jsonParameterObj)) {
                    foreach ($jsonParameterObj as $name => $value) {
                        $this->setParameter($name, $value);
                    }
                }
            }
        }
    }
protected function loadJsonParameters ( ) { $ reflectionObject = new \ ReflectionObject ( $ this ) ; $ componentFile = $ reflectionObject -> getFileName ( ) ; $ parameterFile = dirname ( $ componentFile ) . DIRECTORY_SEPARATOR . pathinfo ( $ componentFile , PATHINFO_FILENAME ) . '.json' ; if ( is_readable ( $ parameterFile ) ) { $ jsonParameters = file_get_contents ( $ parameterFile ) ; if ( strlen ( $ jsonParameters ) ) { $ jsonParameterObj = @ json_decode ( $ jsonParameters ) ; if ( $ jsonParameterObj && is_object ( $ jsonParameterObj ) ) { foreach ( $ jsonParameterObj as $ name => $ value ) { $ this -> setParameter ( $ name , $ value ) ; } } } } }
Load parameters provided from an external JSON file
Load parameters provided from an external JSON file