aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/fixtures/ext/foo/bar/controller/controller.php
blob: 259d54829908724ad91bec58d06c40f9c8494bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

namespace foo\bar\controller;

use Symfony\Component\HttpFoundation\Response;

class controller
{
	protected $template;

	public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template)
	{
		$this->template = $template;
		$this->helper = $helper;
	}

	public function handle()
	{
		return new Response('foo/bar controller handle() method', 200);
	}

	public function baz($test)
	{
		return new Response('Value of "test" URL argument is: ' . $test);
	}

	public function template()
	{
		$this->template->assign_var('A_VARIABLE', 'I am a variable');

		return $this->helper->render('foo_bar_body.html');
	}

	public function exception()
	{
		throw new \phpbb\controller\exception('Exception thrown from foo/exception route');
	}
}