PHP Класс Elgg\FormsService

Use the elgg_* versions instead.
С версии: 2.3
Показать файл Открыть проект

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

Метод Описание
__construct ( ViewsService $views, Logger $logger ) Constructor
getFooter ( ) : string | false Returns currently set footer, or false if not in the form rendering stack
render ( string $action, array $form_vars = [], array $body_vars = [] ) : string Convenience function for generating a form from a view in a standard location.
setFooter ( string $footer = '' ) : boolean Sets form footer and defers its rendering until the form view and extensions have been rendered.

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

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

Constructor
public __construct ( ViewsService $views, Logger $logger )
$views ViewsService Views service
$logger Logger Logger service

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

Returns currently set footer, or false if not in the form rendering stack
public getFooter ( ) : string | false
Результат string | false

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

This function assumes that the body of the form is located at "forms/$action" and sets the action by default to "action/$action". Automatically wraps the forms/$action view with a
tag and inserts the anti-csrf security tokens.
public render ( string $action, array $form_vars = [], array $body_vars = [] ) : string
$action string The name of the action. An action name does not include the leading "action/". For example, "login" is an action name.
$form_vars array $vars passed to the "input/form" view
$body_vars array $vars passed to the "forms/" view
Результат string The complete form

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

Deferring footer rendering allows plugins to extend the form view while maintaining logical DOM structure. Footer will be rendered using 'elements/forms/footer' view after form body has finished rendering
public setFooter ( string $footer = '' ) : boolean
$footer string Footer
Результат boolean