Skip to content

Latest commit

 

History

History
203 lines (133 loc) · 4.32 KB

File metadata and controls

203 lines (133 loc) · 4.32 KB

BumbleDocGen / Technical description of the project / Renderer / Template functions / FileGetContents


namespace BumbleDocGen\Core\Renderer\Twig\Function;

final class FileGetContents implements \BumbleDocGen\Core\Renderer\Twig\Function\CustomFunctionInterface
Displaying the content of a file or web resource

See:

Examples of using:

{{ fileGetContents('https://www.php.net/manual/en/function.file-get-contents.php') }}
{{ fileGetContents('%templates_dir%/../config.yaml') }}

Settings:

Function name: fileGetContents

Initialization methods:

  1. __construct

Methods:

  1. __invoke
  2. getName
  3. getOptions

Method details:

public function __construct(\BumbleDocGen\Core\Configuration\ConfigurationParameterBag $parameterBag);

Parameters:

Name Type Description
$parameterBag \BumbleDocGen\Core\Configuration\ConfigurationParameterBag -

public function __invoke(string $resourceName): string;

Parameters:

Name Type Description
$resourceName string Resource name, url or path to the resource. The path can contain shortcodes with parameters from the configuration (%param_name%)

Return value: string


public static function getName(): string;

Parameters: not specified

Return value: string


public static function getOptions(): array;

Parameters: not specified

Return value: array