forked from friendica/friendica-directory
- Add config/pages directory - Add new custom pages controller and route - Add generated links in the footerstable
parent
8c1d4404c7
commit
e36805c206
@ -1,4 +1,6 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
!.gitignore
|
||||
# And the pages subdirectory
|
||||
!pages
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Friendica\Directory\Controllers\Web;
|
||||
|
||||
/**
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Page extends BaseController
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $pageFile;
|
||||
|
||||
public function __construct(
|
||||
string $pageFile
|
||||
)
|
||||
{
|
||||
$this->pageFile = $pageFile;
|
||||
}
|
||||
|
||||
public function render(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args): array
|
||||
{
|
||||
$content = file_get_contents($this->pageFile);
|
||||
|
||||
return ['content' => $content];
|
||||
}
|
||||
}
|
@ -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…
Reference in new issue