PHP Класс PostController, vanilla

Наследование: extends AppController
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$DiscussionModel DiscussionModel
$Form Gdn_Form
$FormCollection An associative array of form types and their locations.
$ShowCategorySelector Whether or not to show the category dropdown.
$Uses Models to include.

Открытые методы

Метод Описание
announceOptions ( ) : array Get available announcement options for discussions.
comment ( integer $DiscussionID = '' ) Create or update a comment.
comment2 ( integer $CommentID, boolean $Inserted = false ) Triggers saving the extra info about a comment like notifications and unread totals.
discussion ( $CategoryUrlCode = '' ) Create or update a discussion.
editComment ( integer $CommentID = '', integer $DraftID = '' ) Edit a comment (wrapper for PostController::Comment).
editDiscussion ( integer $DiscussionID = '', integer $DraftID = '' ) Edit a discussion (wrapper for PostController::Discussion).
index ( $CurrentFormName = 'discussion' ) General "post" form, allows posting of any kind of form. Attach to PostController_AfterFormCollection_Handler.
initialize ( ) Include CSS for all methods.
notifyNewDiscussion ( $DiscussionID )

Защищенные методы

Метод Описание
populateForm ( Gdn_Form $Form ) Pre-populate the form with values from the query string.

Описание методов

announceOptions() публичный Метод

Get available announcement options for discussions.
С версии: 2.1
public announceOptions ( ) : array
Результат array

comment() публичный Метод

Create or update a comment.
С версии: 2.0.0
public comment ( integer $DiscussionID = '' )
$DiscussionID integer Unique ID to add the comment to. If blank, this method will throw an error.

comment2() публичный Метод

Triggers saving the extra info about a comment like notifications and unread totals.
С версии: 2.0.?
public comment2 ( integer $CommentID, boolean $Inserted = false )
$CommentID integer Unique ID of the comment.
$Inserted boolean

discussion() публичный Метод

Create or update a discussion.
С версии: 2.0.0
public discussion ( $CategoryUrlCode = '' )

editComment() публичный Метод

Will throw an error if both params are blank.
С версии: 2.0.0
public editComment ( integer $CommentID = '', integer $DraftID = '' )
$CommentID integer Unique ID of the comment to edit.
$DraftID integer Unique ID of the draft to edit.

editDiscussion() публичный Метод

Will throw an error if both params are blank.
С версии: 2.0.0
public editDiscussion ( integer $DiscussionID = '', integer $DraftID = '' )
$DiscussionID integer Unique ID of the discussion to edit.
$DraftID integer Unique ID of draft discussion to edit.

index() публичный Метод

General "post" form, allows posting of any kind of form. Attach to PostController_AfterFormCollection_Handler.
С версии: 2.0.0
public index ( $CurrentFormName = 'discussion' )

initialize() публичный Метод

Always called by dispatcher before controller's requested method.
С версии: 2.0.0
public initialize ( )

notifyNewDiscussion() публичный Метод

public notifyNewDiscussion ( $DiscussionID )

populateForm() защищенный Метод

Pre-populate the form with values from the query string.
protected populateForm ( Gdn_Form $Form )
$Form Gdn_Form

Описание свойств

$DiscussionModel публичное свойство

public DiscussionModel $DiscussionModel
Результат DiscussionModel

$Form публичное свойство

public Gdn_Form $Form
Результат Gdn_Form

$FormCollection публичное свойство

An associative array of form types and their locations.
public $FormCollection

$ShowCategorySelector публичное свойство

Whether or not to show the category dropdown.
public $ShowCategorySelector

$Uses публичное свойство

Models to include.
public $Uses