Access component variables in it’s controller in symfony 1.0

Posted December 16th, 2010 in Snippets by Metod

Today I was wondering how to access variables in a symfony component controller that were passed there through third parameter in a include_component() call. So I found a solution and am posting this as a reminder to me or anyone else who is stuck with symfony 1.0 and is wondering the same thing. You can call this method inside your class someComponents extends sfComponents.

  1. $vars = $this->getVarHolder()->getAll();

Returns an associative array of variables.