Ouzo\Utilities\Files::loadIfExists PHP 메소드

loadIfExists() 공개 정적인 메소드

Loads a file using require or require_once if the $loadOnce flag is set to true.
public static loadIfExists ( string $path, boolean $loadOnce = true ) : boolean
$path string
$loadOnce boolean
리턴 boolean
    public static function loadIfExists($path, $loadOnce = true)
    {
        if (self::exists($path)) {
            self::_require($path, $loadOnce);
            return true;
        }
        return false;
    }

Usage Example

예제 #1
0
파일: View.php 프로젝트: letsdrink/ouzo
 private function _loadHelpers()
 {
     $viewHelperPath = Path::join('Helper', 'ViewHelper.php');
     $appHelperPath = Path::join(ROOT_PATH, ApplicationPaths::getHelperPath(), 'ApplicationHelper.php');
     $formHelperPath = Path::join('Helper', 'FormHelper.php');
     $urlHelperPath = Path::join(ROOT_PATH, ApplicationPaths::getHelperPath(), 'UrlHelper.php');
     $this->_requireOnce($viewHelperPath);
     Files::loadIfExists($appHelperPath);
     $this->_requireOnce($formHelperPath);
     Files::loadIfExists($urlHelperPath);
 }
All Usage Examples Of Ouzo\Utilities\Files::loadIfExists