1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\Routing;
12:
13: use Autarky\Container\ContainerAwareInterface;
14:
15: /**
16: * Base web controller class for convenience and accessibility to newcomers.
17: *
18: * Although this class is named "Controller", this does not mean that *only*
19: * classes that extend this class can be mapped to a route in the framework. Any
20: * plain PHP class with a method that returns a string or a Response object can
21: * be used as a controller. This class is simply a convenience class, with a lot
22: * of common utility methods already implemented, like dealing with the session,
23: * rendering templates, returning various responses, and more.
24: *
25: * If you are unable to extend the controller class for any reason, you can just
26: * use the trait instead:
27: *
28: * <pre>
29: * class MyController extends SomethingElse
30: * {
31: * use \Autarky\Routing\ControllerTrait;
32: * }
33: * </pre>
34: */
35: abstract class Controller implements ContainerAwareInterface
36: {
37: /**
38: * Import the trait.
39: */
40: use ControllerTrait;
41: }
42: