Skip to content

Instantly share code, notes, and snippets.

@jamesfinley
Created July 2, 2011 14:54
Show Gist options
  • Select an option

  • Save jamesfinley/1060632 to your computer and use it in GitHub Desktop.

Select an option

Save jamesfinley/1060632 to your computer and use it in GitHub Desktop.
$variables = $this->input->post('variables');
if ($variables)
{
foreach ($variables as $key=>$variable)
{
$page->variable($key, $variable);
}
foreach ($page->template->template_variables->all() as $tv)
{
$v = $page->page_variables->first(array('name' => $tv->name));
$v->label = $tv->label;
$v->type = $tv->type;
$v->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment