Skip to content

Instantly share code, notes, and snippets.

@tonyhb
Created May 10, 2011 11:47
Show Gist options
  • Save tonyhb/964325 to your computer and use it in GitHub Desktop.
Save tonyhb/964325 to your computer and use it in GitHub Desktop.
Set example from Kohana
public function set($values, $value = NULL)
{
if ($value)
{
// Normalise single field setting to multiple field setting
$values = array($values => $value);
}
if ( ! $values)
return $this;
foreach ($values as $key => $value)
{
$this->_data[$key] = $value;
}
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment