[TYPO3-mvc] fluid: object.accessor and method with arguments
Peter Niederlag
typo3-list at niekom.de
Mon Mar 29 11:30:39 CEST 2010
Hello,
Peter Niederlag schrieb:
> Hello,
[...]
> Implementing a ViewHelper for this seems not the right way to me, as
> this doen't belong to the view but to the model/business logic.
Well, I now just implemented a generic 'MethodInvocation' ViewHelper. :->
<h:methodInvocation object="{myObject}" method="doSomethingFancy"
params="{0:'literal param',1: anotherObject.property}" />
/**
* calls a method on an object (optional passing in any parameters)
*
* @param object $object the object where to call the method
* @param string $method the method which should be invoked
* @param array $params (optional) parameters to pass to the method
* @return string output of the invoked method
* @author Jpeter Niederlag
*/
public function render($object, $method, $params = array()) {
// ...
}
Greets,
Peter
--
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
More information about the TYPO3-project-typo3v4mvc
mailing list