Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Call PHP Function dynamically (usable for some TYPO3 Extbase projects)
- # old and eval way
- public function anything($record, $field) {
- // call e.g. $record->getTitle();
- eval('$arr[] = $record->get' . ucfirst($field) . '();');
- }
- # nice way with PHP5
- public function anything($record, $field) {
- // call e.g. $record->getTitle();
- $arr[] = $record->{'get' . ucfirst($field)}();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement