forked from GNUsocial/gnu-social
[MODULES] Rename extensions to modules, add example plugin, change plugin location
This commit is contained in:
14
plugins/Test/Controller/TestController.php
Normal file
14
plugins/Test/Controller/TestController.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class TestController extends AbstractController
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
return new Response('<div style="background: #333; text: #999"> Test controller </div>');
|
||||
}
|
||||
}
|
11
plugins/Test/Test.php
Normal file
11
plugins/Test/Test.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Test;
|
||||
|
||||
class Test
|
||||
{
|
||||
public function onTest(string $foo)
|
||||
{
|
||||
dump('Event handled: ' . $foo);
|
||||
}
|
||||
}
|
15
plugins/Test/manifest.yaml
Normal file
15
plugins/Test/manifest.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: 'Example'
|
||||
version: '0.1'
|
||||
author: 'Hugo Sales'
|
||||
homepage: '{project_url}'
|
||||
description: |
|
||||
Test plugin
|
||||
Description can use multiple lines
|
||||
|
||||
permissions:
|
||||
database:
|
||||
- 'table1': 'r'
|
||||
- 'table2': 'rw'
|
||||
filesystem:
|
||||
- 'folder': 'rw'
|
Reference in New Issue
Block a user