- UPDATE/INSERT often can be updated to a single
db_merge. - Don't forget to
->execute()yourdb_select/db_insert/etc - Themes can have many variables and you might want to do
function theme_fivestar_preview($variables) {
$theme_definition = fivestar_theme();
foreach ($theme_definition['fivestar_preview']['arguments'] as $key => $default) {
$$key = $variables[$key];
}
Edit: merlinofchaos suggests simplyextract($variables, EXTR_SKIP);because that's what templates do.
Commenting on this Story is closed.



![Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]](../sites/all/themes/drupal4hu/images/bg-center/bg-center_4.png)















The signature of hook_theme is not as easy :( hook_theme($existing, $type, $theme, $path)
I would use
<?php$hooks = theme_get_registry();
foreach ($hooks['foo']['arguments'] as $key => $default) {
$$key = $variables[$key];
}
?>
Thanks for the info. I just started learning the syntax and the platform! Tell me, can be helpful xp tweaks for it? I'm very grateful for your response!