pkit_get_config_attr — Returns the value of the attr you ask for.


$hash_ref = $model->pkit_get_config_attr('GLOBAL');
$default_page = $model->pkit_get_config_attr( GLOBAL => 'default_page');

$hash_ref = $model->pkit_get_config_attr('SERVER');
$id = $model->pkit_get_config_attr('SERVER', 'id');

$all_pages_hash_ref = $model->pkit_get_config_attr('PAGES');
$hash_ref = $model->pkit_get_config_attr('PAGE', 'restricted');
$require_login = $model->pkit_get_config_attr('PAGE', 'restricted', 'require_login');

$all_views_hash_ref = $model->pkit_get_config_attr('VIEWS');
$hash_ref = $model->pkit_get_config_attr('VIEW', 'pdf');
$media    = $model->pkit_get_config_attr('VIEW', 'pdf', 'media');

$hash_ref = $model->pkit_get_config_attr('USER');
$location = $model->pkit_get_config_attr('USER', 'location');


The first argument is the sectionname in your Config/Config.xml this can be one of GLOBAL|SERVER|PAGES|PAGE|VIEWS|VIEW|USER. If no more arguments are given, you get a hashref with all tags as keys and all attrs as values for the section in question back. For the sections PAGE and VIEW you get a href back which values are a href to the subsections. If you call to with two params, the second parameter is the name of the key you ask for. The three parameter form is only allowed for pages and views, where the second argument is the page or view and the third is the name of the key you are interested in. If nothing is found, undef is returned. Otherwise the attr you ask for or a hashref. Note, that the value you get is the value in the Config.xml this is not ever the same as the value pagekit is working with. Ie: if you ask for pkit_get_config_attr( GLOBAL => 'default_page' ); you might get undef but PageKit uses 'index' as this is the default.