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



Provides read access to settings in the configuration files.


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


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.


A string containing the value of a configuration setting.


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.


Example 1

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

Conditional branching based on an configuration setting.

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

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


There are no comments.