private ISourceModule input;
private PHPStructuredEditor editor;
private IHyperlink getControllerlink(ViewPath viewPath, IRegion wordRegion) {
IType controller = SymfonyModelAccess.getDefault().findController(viewPath.getBundle(), viewPath.getController(), input.getScriptProject());
if (controller != null) {
String tpl = viewPath.getTemplate();
// try to open a corresponding action
try {
String action = tpl.substring(0, tpl.indexOf("."));
if (action.length() > 0) {
IMethod method = controller.getMethod(action + "Action");
return new ModelElementHyperlink(wordRegion, method, new OpenAction(editor));
}
} catch (Exception e) {
// ignore and open the controller
}