// Get the value from value instance
$fieldValue = $this->getField($fieldName);
- // Add a group
- $this->getTemplateInstance()->setVariableGroup('values');
-
// Assign it with a template variable
- $this->getTemplateInstance()->addGroupVariable($fieldName, $fieldValue);
+ $this->getTemplateInstance()->assignVariable("block_" . $fieldName, $fieldValue);
}
/**
* @param $fieldName Name of the field to assign
* @param $filterMethod Method name to call of the value instance
* @return void
+ * @todo Rewrite this method using a helper class for filtering data
*/
public function assignFieldWithFilter ($fieldName, $filterMethod) {
// Get the value
$fieldValue = $this->getField($fieldName);
// Now filter it through the value through the filter method
- $filteredValue = call_user_func_array(array($this->valueInstance, "doFilter" . ucfirst($filterMethod)), array($fieldValue));
-
- // Add a group
- $this->getTemplateInstance()->setVariableGroup('values');
+ $filteredValue = call_user_func_array(array($this, "doFilter" . ucfirst($filterMethod)), array($fieldValue));
// Assign it with a template variable
- $this->getTemplateInstance()->addGroupVariable($fieldName, $fieldValue);
+ $this->getTemplateInstance()->assignVariable("block_" . $fieldName, $filteredValue);
}
/**