Add Custom Pages feature
- Add config/pages directory - Add new custom pages controller and route - Add generated links in the footer
This commit is contained in:
parent
8c1d4404c7
commit
e36805c206
7 changed files with 68 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ abstract class BaseRoute
|
|||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args): \Slim\Http\Response
|
||||
{
|
||||
$defaults = [
|
||||
'pages' => glob(__DIR__ . '/../../../../config/pages/*.html'),
|
||||
'version' => file_get_contents(__DIR__ . '/../../../../VERSION'),
|
||||
'languages' => $this->container->settings['i18n']['locales'],
|
||||
'lang' => $request->getAttribute('locale'),
|
||||
|
|
|
|||
18
src/classes/Routes/Web/Pages.php
Normal file
18
src/classes/Routes/Web/Pages.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Directory\Routes\Web;
|
||||
|
||||
/**
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Pages extends BaseRoute
|
||||
{
|
||||
public function __construct(\Slim\Container $container, $pageFile)
|
||||
{
|
||||
parent::__construct($container);
|
||||
|
||||
$this->controller = new \Friendica\Directory\Controllers\Web\Page(
|
||||
$pageFile
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue