Skip to content

Instantly share code, notes, and snippets.

@andrewn
Created June 14, 2011 10:58
Show Gist options
  • Save andrewn/1024679 to your computer and use it in GitHub Desktop.
Save andrewn/1024679 to your computer and use it in GitHub Desktop.
<~method embedComponent($name,$args)>
<?
$defaults = array(
'translator' => $this->translator,
'language' => $this->language);
$view = self::view( "/_components/{$name}.spv",
array_merge($defaults,$args));
if ( isset($this->viewData) ) {
foreach ( $this->viewData as $varName => $var ) {
$view->$varName = $var;
}
}
$view->render();
?>
</~method>
// HACK: Is there a supported way of fetching all
// variables from the view?
// Used to propagate variables to subviews.
$viewData = $this->view->_spectrumViewData;
$this->view->assign("viewData", $viewData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment