pkit_component_params_hashref

Name

pkit_component_params_hashref — Can be used to get the parameters of a component.

Synopsis


     # suppose this is in your whatever.tmpl
     <PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table">
     <PKIT_COMPONENT NAME="xxx" headline="another_title" datasrc="select * from another_table">
     <PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table">

     and in your dont_know.pm

     sub xxx {
       my $model = shift;
       my $fields = $model->pkit_component_params_hashref;
       my $select_statement = $fields->{DATASRC};
       ...
    }
     
     

Description

Can be used to build reuseable components for common or similar tasks. In the hashref are all keys and values from the PKIT_COMPONENT tag, expect the name of the component. If the parameters are exactly the same like the first and the third line in the example, the component code is called only once. All keys in the hash are in uppercase. if pkit_component_params_hashref is called outside of a component, it returns undef.