Documentation

MessagesController extends AppController
in package

Messages Controller Handles user-to-user private messaging.

Table of Contents

Properties

$Messages  : MessagesTable

Methods

beforeRender()  : mixed
index()  : void
Index method Displays the initial messaging interface (sidebar handled by a Cell).
initialize()  : void
Initialization hook method.
sendMessage()  : Response|null
SendMessage method Handles the submission of a new message via POST.
start()  : Response|null
Start method Initiates or verifies a conversation with a friend.
view()  : Response|null|void
View method Displays the chat history with a specific friend.

Properties

Methods

beforeRender()

public beforeRender(EventInterface $event) : mixed
Parameters
$event : EventInterface

index()

Index method Displays the initial messaging interface (sidebar handled by a Cell).

public index() : void

initialize()

Initialization hook method.

public initialize() : void

Use this method to add common initialization code like loading components.

e.g. $this->loadComponent('FormProtection');

sendMessage()

SendMessage method Handles the submission of a new message via POST.

public sendMessage() : Response|null
Return values
Response|null

Redirects back to the conversation view.

start()

Start method Initiates or verifies a conversation with a friend.

public start([string|null $friendId = null ]) : Response|null
Parameters
$friendId : string|null = null

The ID of the friend to chat with.

Tags
throws
ForbiddenException
Return values
Response|null

Redirects to the conversation view.

view()

View method Displays the chat history with a specific friend.

public view([string|null $friendId = null ]) : Response|null|void
Parameters
$friendId : string|null = null

The ID of the friend.

Return values
Response|null|void

Renders view or redirects if no ID.


        
On this page

Search results