Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

ezini

Summary

Provides read access to settings in the configuration files.

Usage

ezini( section, variable [, ini_file [, ini_path [, dynamic [, check_existence ] ] ] ] )

Parameters

NameTypeDescriptionRequired
section string Section to read value from. Yes.
variable string The name of the directive that should be accessed. Yes.
ini file string The target configuration file (default is "site.ini"). No.
ini_path string Custom path to the configuration file(s). No.
dynamic boolean If the specified directive should be dynamically checked. No.
check_existence mixed If the specified directive should be checked for existence. No.

Returns

A string containing the value of a configuration setting.

Description

This operator makes it possible to access the settings in the configuration ("*.ini") files. The "ini_path" operator can be used to set a custom path where the configuration files are located (default is the settings directory). The "dynamic" parameter can be used to force the system to actually check the ini file, otherwise the value will be checked upon template compilation and "hardcoded" in the compiled template. The "check_existence" parameter can be set to TRUE or the string "hasVariable" in order to check if a directive is actually set. In this case, the operator will return either TRUE or FALSE. Note that using the "ezini_hasvariable" operator is a better option.

Examples

Example 1

{if eq(ezini( 'SomeSettings', 'Test', 'example.ini' ), 'hello' )}
    [...display something...]
{else}
    [...display something else...]
{/if}

Conditional branching based on an configuration setting.

Balazs Halasy (05/02/2004 10:32 am)

Balazs Halasy (01/04/2007 4:39 pm)


Comments

  • Return value

    the return value also can be a array of strings