Menu

## CrudkitController extends Controller
in package

CrudkitController.php : 30

Crudkit Controller

Contains code for all the endpoints defined in rountes.php.

##### Tags

internal

### Table of Contents

CRUDKIT_VERSION = 'v1.0.0-rc.1'
$authHelper : AuthHelper
$pageStore : PageStore
__construct() : mixed
  Creates a new controller instance
action() : RedirectResponse
  Executes a predefined callback action for a specific page (action button)
ajaxCustom() : mixed
ajaxManyToOne() : mixed
autoGenerate() : mixed
  Automatic generation of a CurdkitServiceProvider.php
cardView() : Response
  Displays a singe recorda as a card page
chartView() : Response
  Displays records as a chart
createRecord() : RedirectResponse
  Creates a record
createView() : Response
  The view for creating a new record.
deleteRecord() : RedirectResponse
  Deletes a record from the database
exportRecordsCsv() : mixed
  Exports a page as CSV (including filters and search but). Ignores limitatin by pagination,
exportRecordsXml() : mixed
  Exports a page as XML (including filters and search but). Ignores limitatin by pagination,
getChartData() : string
  Creates Chart data based on the page, filters and search in form ob a JSON object.
index() : mixed
  Brings up the startpage or login view, if not logged in
init() : mixed
  Set pages and authHelper.
listView() : Response
  Displays records as a summary/list page
login() : RedirectResponse
  Performs the login
loginView() : Response
  Login page
logout() : RedirectResponse
  Performs the logout
messageView() : Response
  View for displaying a message.
setTheme() : mixed
updateRecord() : RedirectResponse
  Updates a record
updateView() : Response
  The view for editing an existing record.
csvLookup() : mixed
getHtmlInputAttributes() : string
  Fetches all columns (no data) an crates necessary html <input> attributes. Such as "readonly".

### Constants

#### CRUDKIT_VERSION

CrudkitController.php : 34
`private string CRUDKIT_VERSION = 'v1.0.0-rc.1'`

The CRUDKit version

### Properties

#### $authHelper

CrudkitController.php : 38
`private AuthHelper $authHelper = null`

Holding user/permission related data.

#### $pageStore

CrudkitController.php : 36
`private PageStore $pageStore = null`

All the pages.

### Methods

#### __construct()

CrudkitController.php : 50

Creates a new controller instance

`public __construct() : mixed`

##### Return values

mixed —

#### action()

CrudkitController.php : 634

Executes a predefined callback action for a specific page (action button)

`public action(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### ajaxCustom()

CrudkitController.php : 1200
`public ajaxCustom() : mixed`

##### Return values

mixed —

#### ajaxManyToOne()

CrudkitController.php : 1121
`public ajaxManyToOne() : mixed`

##### Return values

mixed —

#### autoGenerate()

CrudkitController.php : 76

Automatic generation of a CurdkitServiceProvider.php

`public autoGenerate(Request $request) : mixed`

##### Parameters

$request : Request

##### Return values

mixed —

#### cardView()

CrudkitController.php : 183

Displays a singe recorda as a card page

`public cardView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### chartView()

CrudkitController.php : 341

Displays records as a chart

`public chartView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### createRecord()

CrudkitController.php : 525

Creates a record

`public createRecord(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### createView()

CrudkitController.php : 294

The view for creating a new record.

`public createView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### deleteRecord()

CrudkitController.php : 498

Deletes a record from the database

`public deleteRecord(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### exportRecordsCsv()

CrudkitController.php : 669

Exports a page as CSV (including filters and search but). Ignores limitatin by pagination,

`public exportRecordsCsv(Request $request) : mixed`

##### Parameters

$request : Request

##### Tags

action

##### Return values

mixed —

#### exportRecordsXml()

CrudkitController.php : 814

Exports a page as XML (including filters and search but). Ignores limitatin by pagination,

`public exportRecordsXml(Request $request) : mixed`

##### Parameters

$request : Request

##### Tags

action

##### Return values

mixed —

#### getChartData()

CrudkitController.php : 910

Creates Chart data based on the page, filters and search in form ob a JSON object.

`public getChartData(Request $request) : string`

Called via Javascript.

##### Parameters

$request : Request

##### Tags

action

##### Return values

string —

Chart data as json object (for javascript)

#### index()

CrudkitController.php : 88

Brings up the startpage or login view, if not logged in

`public index(Request $request) : mixed`

##### Parameters

$request : Request

##### Tags

view

##### Return values

mixed —

#### init()

CrudkitController.php : 65

Set pages and authHelper.

`public init(PageStroe $pageStore[, AuthHelper $authHelper = null ]) : mixed`

##### Parameters

$pageStore : PageStroe
$authHelper : AuthHelper = null

##### Return values

mixed —

#### listView()

CrudkitController.php : 104

Displays records as a summary/list page

`public listView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### login()

CrudkitController.php : 584

Performs the login

`public login(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### loginView()

CrudkitController.php : 466

Login page

`public loginView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### logout()

CrudkitController.php : 603

Performs the logout

`public logout(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### messageView()

CrudkitController.php : 408

View for displaying a message.

`public messageView(Request $request) : Response`

These are the request parameters:

- title: The title for the message windows
- message: The text for message itself
- message-html: The text for message itself with html encluded
- type: For the theme of the message. Valid types are 'success', 'warning', 'info', 'danger'

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### setTheme()

CrudkitController.php : 611
`public setTheme(Request $request) : mixed`

##### Parameters

$request : Request

##### Return values

mixed —

#### updateRecord()

CrudkitController.php : 553

Updates a record

`public updateRecord(Request $request) : RedirectResponse`

##### Parameters

$request : Request

##### Tags

action

##### Return values

RedirectResponse —

#### updateView()

CrudkitController.php : 242

The view for editing an existing record.

`public updateView(Request $request) : Response`

##### Parameters

$request : Request

##### Tags

view

##### Return values

Response —

#### csvLookup()

CrudkitController.php : 787
`private csvLookup(bool $header, bool $exportLookups, array<string|int, mixed> $lookups, string $position, string $columnName, array<string|int, mixed> &$line) : mixed`

##### Parameters

$header : bool
$exportLookups : bool
$lookups : array<string|int, mixed>
$position : string
$columnName : string
$line : array<string|int, mixed>

##### Return values

mixed —

#### getHtmlInputAttributes()

CrudkitController.php : 1093

Fetches all columns (no data) an crates necessary html <input> attributes. Such as "readonly".

`private getHtmlInputAttributes(array<string|int, SQLColumn> $columns) : string`

##### Parameters

$columns : array<string|int, SQLColumn>

##### Tags

helper

##### Return values

string —

$htmlInputAttributes

## Search results