SetupController
in package
implements
SetupControllerInterface
Table of Contents
Interfaces
Constants
- PREFIX = 'civisetup'
Properties
Methods
- __construct() : mixed
- SetupController constructor.
- createError() : SetupResponse
- createPage() : SetupResponse
- getResourcePath() : mixed
- getSetup() : Setup
- getUrl() : mixed
- render() : string
- Render a *.php template file.
- renderBlocks() : mixed
- run() : SetupResponse
- runInstall() : SetupResponse
- Perform the installation action.
- runStart() : SetupResponse
- Run the main installer page.
- setUrls() : $this
- boot() : mixed
- Partially bootstrap Civi services (such as localization).
- parseAction() : string
- Given an HTML submission, determine the name.
- getCommonTplVars() : array<string|int, mixed>
- renderAlreadyInstalled() : mixed
- renderFinished() : SetupResponse
Constants
PREFIX
public
mixed
PREFIX
= 'civisetup'
Properties
$blocks
public
array<string|int, mixed>
$blocks
A list of blocks to display on the setup page. Each item has:
- file: string, relative path
- class: string, a space-delimited list of CSS classes
- is_active: bool
Note: When rendering a block, content of the block's definition
will be available as $_tpl_block
. For example, $_tpl_block['is_active']
would be the same boolean.
$setup
protected
Setup
$setup
$urls
protected
array<string|int, mixed>
$urls
Some mix of the following:
- res: The base URL for loading resource files (images/javascripts) for this project. Includes trailing slash.
- ctrl: The URL of this setup controller. May be used for POST-backs.
Methods
__construct()
SetupController constructor.
public
__construct(Setup $setup) : mixed
Parameters
- $setup : Setup
createError()
public
createError(string $message[, string $title = 'Error' ]) : SetupResponse
Parameters
- $message : string
- $title : string = 'Error'
Return values
SetupResponsecreatePage()
public
createPage(string $title, string $body) : SetupResponse
Parameters
- $title : string
- $body : string
Return values
SetupResponsegetResourcePath()
public
getResourcePath(mixed $parts) : mixed
Parameters
- $parts : mixed
getSetup()
public
getSetup() : Setup
Return values
SetupgetUrl()
public
getUrl(mixed $name) : mixed
Parameters
- $name : mixed
render()
Render a *.php template file.
public
render(string $_tpl_file[, array<string|int, mixed> $_tpl_params = array() ]) : string
Parameters
- $_tpl_file : string
-
The path to the file.
- $_tpl_params : array<string|int, mixed> = array()
-
Any variables that should be exported to the scope of the template.
Return values
stringrenderBlocks()
public
renderBlocks(mixed $_tpl_params) : mixed
Parameters
- $_tpl_params : mixed
run()
public
run(string $method[, array<string|int, mixed> $fields = array() ]) : SetupResponse
Parameters
- $method : string
-
Ex: 'GET' or 'POST'.
- $fields : array<string|int, mixed> = array()
-
List of any HTTP GET/POST fields.
Return values
SetupResponserunInstall()
Perform the installation action.
public
runInstall(string $method, array<string|int, mixed> $fields) : SetupResponse
Parameters
- $method : string
-
Ex: 'GET' or 'POST'.
- $fields : array<string|int, mixed>
-
List of any HTTP GET/POST fields.
Return values
SetupResponserunStart()
Run the main installer page.
public
runStart(string $method, array<string|int, mixed> $fields) : SetupResponse
Parameters
- $method : string
-
Ex: 'GET' or 'POST'.
- $fields : array<string|int, mixed>
-
List of any HTTP GET/POST fields.
Return values
SetupResponsesetUrls()
public
setUrls(mixed $urls) : $this
Parameters
- $urls : mixed
-
Some mix of the following:
- res: The base URL for loading resource files (images/javascripts) for this project. Includes trailing slash.
- ctrl: The URL of this setup controller. May be used for POST-backs.
Tags
Return values
$thisboot()
Partially bootstrap Civi services (such as localization).
protected
boot(mixed $method, mixed $fields) : mixed
Parameters
- $method : mixed
- $fields : mixed
parseAction()
Given an HTML submission, determine the name.
protected
parseAction(array<string|int, mixed> $fields, string $default) : string
Parameters
- $fields : array<string|int, mixed>
-
HTTP inputs -- e.g. with a form element like this:
<button type="submit" name="civisetup[action][Foo]">Do the foo</button>
- $default : string
-
The action-name to return if no other action is identified.
Return values
string —The name of the action. Ex: 'Foo'.
getCommonTplVars()
private
getCommonTplVars() : array<string|int, mixed>
Return values
array<string|int, mixed>renderAlreadyInstalled()
private
renderAlreadyInstalled() : mixed
renderFinished()
private
renderFinished() : SetupResponse