|
18 | 18 | */ |
19 | 19 | interface IController |
20 | 20 | { |
| 21 | + /** |
| 22 | + * Constructor for the controller. |
| 23 | + * |
| 24 | + * @param Application|null $app The application instance. |
| 25 | + */ |
21 | 26 | public function __construct( ?Application $app ); |
22 | 27 |
|
| 28 | + /** |
| 29 | + * Renders an HTML response. |
| 30 | + * |
| 31 | + * @param HttpResponseStatus $responseCode The HTTP response status code. |
| 32 | + * @param array $data Data to be passed to the view. |
| 33 | + * @param string $page The view page to render. |
| 34 | + * @param string $layout The layout to use for rendering. |
| 35 | + * @param bool|null $cacheEnabled Whether caching is enabled for this response. |
| 36 | + * @return string The rendered HTML content. |
| 37 | + */ |
23 | 38 | public function renderHtml( HttpResponseStatus $responseCode, array $data = [], string $page = "index", string $layout = "default", ?bool $cacheEnabled = null ) : string; |
| 39 | + |
| 40 | + /** |
| 41 | + * Renders a Markdown response. |
| 42 | + * |
| 43 | + * @param HttpResponseStatus $responseCode The HTTP response status code. |
| 44 | + * @param array $data Data to be passed to the view. |
| 45 | + * @param string $page The view page to render. |
| 46 | + * @param string $layout The layout to use for rendering. |
| 47 | + * @param bool|null $cacheEnabled Whether caching is enabled for this response. |
| 48 | + * @return string The rendered Markdown content. |
| 49 | + */ |
| 50 | + public function renderMarkdown( HttpResponseStatus $responseCode, array $data = [], string $page = "index", string $layout = "default", ?bool $cacheEnabled = null ) : string; |
| 51 | + |
| 52 | + /** |
| 53 | + * Renders a JSON response. |
| 54 | + * |
| 55 | + * @param HttpResponseStatus $responseCode The HTTP response status code. |
| 56 | + * @param array $data Data to be included in the JSON response. |
| 57 | + * @return string The rendered JSON content. |
| 58 | + */ |
24 | 59 | public function renderJson( HttpResponseStatus $responseCode, array $data = [] ) : string; |
| 60 | + |
| 61 | + /** |
| 62 | + * Renders an XML response. |
| 63 | + * |
| 64 | + * @param HttpResponseStatus $responseCode The HTTP response status code. |
| 65 | + * @param array $data Data to be included in the XML response. |
| 66 | + * @return string The rendered XML content. |
| 67 | + */ |
25 | 68 | public function renderXml( HttpResponseStatus $responseCode, array $data = [] ) : string; |
26 | 69 | } |
0 commit comments