protected function getResource(string $sFile, array $aFields): string
    {
        if (empty(static::RESOURCE_PATH)) {
            throw new NailsException('RESOURCE_PATH is not defined');
        }
        $sResource = require static::RESOURCE_PATH . $sFile;

        foreach ($aFields as $sField => $sValue) {
            $sKey      = '{{' . strtoupper($sField) . '}}';
            $sResource = str_replace($sKey, $sValue, $sResource);
        }

        return $sResource;
    }
protected function getResource(string $sFile, array $aFields): string
    {
        if (empty(static::RESOURCE_PATH)) {
            throw new NailsException('RESOURCE_PATH is not defined');
        }
        $sResource = require static::RESOURCE_PATH . $sFile;

        foreach ($aFields as $sField => $sValue) {
            $sKey      = '{{' . strtoupper($sField) . '}}';
            $sResource = str_replace($sKey, $sValue, $sResource);
        }

        return $sResource;
    }
protected function getResource ( string $ sFile , array $ aFields ) : string { if ( empty ( static :: RESOURCE_PATH ) ) { throw new NailsException ( 'RESOURCE_PATH is not defined' ) ; } $ sResource = require static :: RESOURCE_PATH . $ sFile ; foreach ( $ aFields as $ sField => $ sValue ) { $ sKey = '{{' . strtoupper ( $ sField ) . '}}' ; $ sResource = str_replace ( $ sKey , $ sValue , $ sResource ) ; } return $ sResource ; }
Get a resource and substitute fields into it

@param string $sFile   The file to fetch
@param array  $aFields The template fields

@return string
@throws NailsException
Get a resource and substitute fields into it