ControllerMethods.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\presentation;
12 
13 /**
14  * ControllerMethods implements a doExecute() method, that delegates to the
15  * method provided in its argument.
16  *
17  * @author ingo herwig <ingo@wemove.com>
18  */
19 trait ControllerMethods {
20 
21  /**
22  * @see Controller::doExecute()
23  */
24  protected function doExecute($method=null) {
25  if (method_exists($this, $method)) {
26  call_user_func([$this, $method]);
27  }
28  else {
29  throw new \Exception("The method '".$method."' is not defined in class ".get_class($this));
30  }
31  }
32 }
33 ?>
Presentation related interfaces and classes.
Definition: namespaces.php:59