forked from GNUsocial/gnu-social
[CONTROLLER] Add Controller base class, which handles rendering templates if requested HTML or json, accordingly
This commit is contained in:
@@ -30,18 +30,23 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller;
|
||||
use App\Core\Event;
|
||||
use App\Util\Common;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
class NetworkPublic extends AbstractController
|
||||
class NetworkPublic extends Controller
|
||||
{
|
||||
public function __invoke()
|
||||
public function onPost()
|
||||
{
|
||||
return ['_template' => 'network/public.html.twig'];
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Event::handle('Test', ['foobar']);
|
||||
|
||||
Common::config('url', 'shortener');
|
||||
|
||||
return $this->render('network/public.html.twig', []);
|
||||
return ['_template' => 'network/public.html.twig'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user