baserCMS クラスリファレンス

BcFrontMiddleware
in package
implements MiddlewareInterface

BcFrontMiddleware

Table of Contents

Interfaces

MiddlewareInterface

Methods

process()  : ResponseInterface
Process
setCurrent()  : ServerRequestInterface
現在のページのサイトとコンテンツを ServerRequest に設定する

Methods

process()

Process

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Tags
checked
noTodo
Return values
ResponseInterface

setCurrent()

現在のページのサイトとコンテンツを ServerRequest に設定する

public setCurrent(ServerRequestInterface $request) : ServerRequestInterface

コンテンツ管理により管理されているページの場合

BcContentsRoute によって、$request の param に設定されているので、 そのデータを Attribute にセットしなおす。

###そうでないページの場合 URL より、サイトを判定し、そのサイトのトップページを 現在のコンテンツとしてみなし、ServerRequest に設定する。

Parameters
$request : ServerRequestInterface
Tags
checked
noTodo
unitTest
Return values
ServerRequestInterface

        
On this page

Search results