Documentation

ScrudController extends ControllerBase
in package

Manage tables index, model search, create and read

Table of Contents

$limit  : int
Limit of result by page in listing
$messages  : array<string|int, mixed>
Current lang translated texts
$models  : array<string|int, mixed>
Current request models
$camelize  : Camelize
Object to camelize strings
$uncamelize  : Uncamelize
Object to uncamelize strings
_()  : string
Get a translation by his label in global context
__()  : string
Get a translation by his label in controller/action context
beforeExecuteRoute()  : void
Set default view data
createAction()  : void
Display the create interface
indexAction()  : void
List all database tables by alphabetical order
initialize()  : void
Check url models conformity and include/configure all dependencies
listAction()  : void
Get current selected models items
readAction()  : void
Display the read interface
searchAction()  : void
* Display the search interface
getRows()  : mixed
Get all rows of the selected models

Properties

$messages

Current lang translated texts

public array<string|int, mixed> $messages = []

$models

Current request models

public array<string|int, mixed> $models = []

$uncamelize

Object to uncamelize strings

private Uncamelize $uncamelize

Methods

_()

Get a translation by his label in global context

public _(string $key[, null|array<string|int, mixed> $params = [] ]) : string
Parameters
$key : string

Label of the text

$params : null|array<string|int, mixed> = []
Tags
example

__("hi-name", ["name" => $name])?>

Return values
string

Text translated in the correct lang

__()

Get a translation by his label in controller/action context

public __(string $key[, null|array<string|int, mixed> $params = [] ]) : string
Parameters
$key : string

Label of the text

$params : null|array<string|int, mixed> = []
Tags
example

__("hi-name", ["name" => $name])?>

Return values
string

Text translated in the correct lang

beforeExecuteRoute()

Set default view data

public beforeExecuteRoute(Dispatcher $dispatcher) : void
Parameters
$dispatcher : Dispatcher

Applciation dispatcher

Return values
void

createAction()

Display the create interface

public createAction() : void
Return values
void

indexAction()

List all database tables by alphabetical order

public indexAction() : void
Return values
void

initialize()

Check url models conformity and include/configure all dependencies

public initialize() : void
Return values
void

listAction()

Get current selected models items

public listAction() : void
Return values
void

readAction()

Display the read interface

public readAction() : void
Return values
void

searchAction()

* Display the search interface

public searchAction() : void
Return values
void

getRows()

Get all rows of the selected models

private getRows(array<string|int, mixed> &$params) : mixed
Parameters
$params : array<string|int, mixed>

Query params

Return values
mixed

List of model instances

Search results