CI_Table::_prep_args PHP Méthode

_prep_args() protected méthode

Ensures a standard associative array format for all cell data
protected _prep_args ( $args ) : array
Résultat array
    protected function _prep_args($args)
    {
        // If there is no $args[0], skip this and treat as an associative array
        // This can happen if there is only a single key, for example this is passed to table->generate
        // array(array('foo'=>'bar'))
        if (isset($args[0]) && count($args) === 1 && is_array($args[0]) && !isset($args[0]['data'])) {
            $args = $args[0];
        }
        foreach ($args as $key => $val) {
            is_array($val) or $args[$key] = array('data' => $val);
        }
        return $args;
    }