public multiadd ( Array $name_vals, String $prefix = null ) | ||
$name_vals | Array | array of name/value pairs to add |
$prefix | String | prefix to prepend to each namespace name |
public function multiadd($name_vals, $prefix = null)
{
foreach ($name_vals as $name => $val) {
$this->add("{$prefix}{$name}", $val);
}
}
/** * Merge content blocks for this instance with passed instance * * @param \Basecoat\View $view Instance to add content blocks to * @return Integer number of content blocks merged */ public function addToView($view) { $view->multiadd($this->blocks); return count($this->blocks); }