I want to call a function in a controller from my app_controller, but
want to check it exists first. I've fiddled around with
function_exists but can't get the syntax right. This is the current
version of the code (which doesn't work):
function getRelations($id = null) {
if (function_exists($this->{$this->modelClass}->relations())):
return $this->{$this->modelClass}->relations($id);
else:
return array();
endif;
}
Any ideas?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en