function get_attributes($attributes)
    {

        // initialize the array that will be returned
        $result = array();

        // if the request was for a single attribute,
        // treat it as an array of attributes
        if (!is_array($attributes)) $attributes = array($attributes);

        // iterate through the array of attributes to look for
        foreach ($attributes as $attribute)

            // if attribute exists
            if (array_key_exists($attribute, $this->attributes))

                // populate the $result array
                $result[$attribute] = $this->attributes[$attribute];

        // return the results
        return $result;

    }
function get_attributes($attributes)
    {

        // initialize the array that will be returned
        $result = array();

        // if the request was for a single attribute,
        // treat it as an array of attributes
        if (!is_array($attributes)) $attributes = array($attributes);

        // iterate through the array of attributes to look for
        foreach ($attributes as $attribute)

            // if attribute exists
            if (array_key_exists($attribute, $this->attributes))

                // populate the $result array
                $result[$attribute] = $this->attributes[$attribute];

        // return the results
        return $result;

    }
function get_attributes ( $ attributes ) { // initialize the array that will be returned $ result = array ( ) ; // if the request was for a single attribute, // treat it as an array of attributes if ( ! is_array ( $ attributes ) ) $ attributes = array ( $ attributes ) ; // iterate through the array of attributes to look for foreach ( $ attributes as $ attribute ) // if attribute exists if ( array_key_exists ( $ attribute , $ this -> attributes ) ) // populate the $result array $ result [ $ attribute ] = $ this -> attributes [ $ attribute ] ; // return the results return $ result ; }
Returns the values of requested attributes.

<code>
// create a new form
$form = new Zebra_Form('my_form');

// add a text field to the form
$obj = $form->add('text', 'my_text');

// set some attributes for the text field
$obj->set_attributes(array(
'readonly'  => 'readonly',
'style'     => 'font-size:20px',
));

// retrieve the attributes
$attributes = $obj->get_attributes(array('readonly', 'style'));

// the result will be an associative array
//
// $attributes = Array(
//      [readonly]  => "readonly",
//      [style]     => "font-size:20px"
// )
</code>

@param  mixed   $attributes     A single or an array of attributes for which the values to be returned.

@return array                   Returns an associative array where keys are the attributes and the values are
each attribute's value, respectively.
Returns the values of requested attributes .