Yaf_Config_Ini::valid
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Check if current position is valid
Description
Yaf_Config_Ini::valid(): bool
Checks whether the current iterator position is valid.
Parameters Parameters
Return Values
Returns true if the current position is valid, false otherwise.
Examples
Yaf_Config_Ini::valid example
php
<?php
/**
* Assume /etc/myapp/application.ini contains:
* [common]
* application.name = "MyApp"
* version = "1.0"
*/
$config = new Yaf_Config_Ini('/etc/myapp/application.ini', 'common');
$config->rewind();
var_dump($config->valid());
$config->next();
var_dump($config->valid());
$config->next(); // past the last entry
var_dump($config->valid());
?>The above example will output something similar to:
output
bool(true)
bool(true)
bool(false)See Also
Yaf_Config_Ini::currentYaf_Config_Ini::keyYaf_Config_Ini::nextYaf_Config_Ini::rewind