Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
MultiResourceCRUDController Class Reference
+ Inheritance diagram for MultiResourceCRUDController:

Public Member Functions

 initialize ()
 Method called before each action Can be override in derived class.
 
 home ()
 
 _getBaseRoute ()
 
 showDetail ($ids)
 Shows associated members with foreign keys.
 
 showModelClick ($modelAndId)
 
- Public Member Functions inherited from CRUDController
 __construct ()
 Constructor initialize $view variable.
 
 _setStyle ($elm)
 
 index ()
 Default page : list all objects Uses modelViewer.isModal, modelViewer.getModelDataTable Uses CRUDFiles.getViewIndex template (default : @framework/crud/index.html) Triggers the events onDisplayElements,beforeLoadView.
 
 updateMember ($member, $callback=false)
 
 refresh_ ()
 Refreshes the area corresponding to the DataTable.
 
 edit ($modal="no", $ids="")
 Edits an instance.
 
 newModel ($modal="no")
 Adds a new instance and edits it.
 
 editMember ($member)
 
 display ($modal="no", $ids="")
 Displays an instance.
 
 delete ($ids)
 Deletes an instance.
 
 refreshTable ($id=null)
 
 updateModel ()
 Updates an instance from the data posted in a form.
 
 detailClick ($url, $responseElement='#divTable', $attributes=["attr"=> "data-ajax"])
 
- Public Member Functions inherited from ControllerBase
 finalize ()
 Method called after each action Can be override in derived class.
 
- Public Member Functions inherited from Controller
 loadView (string $viewName, $pData=null, bool $asString=false)
 Loads the view $viewName possibly passing the variables $pdata.
 
 loadDefaultView ($pData=null, bool $asString=false)
 Loads the default view (controllerName/actionName) possibly passing the variables $pdata.
 
 getDefaultViewName ()
 Returns the default view name for this controller/action i.e ControllerName/actionName.html for the action actionName in ControllerName If there is an activeTheme @activeTheme/ControllerName/actionName.html
 
 isValid ($action)
 Returns True if access to the controller is allowed To be override in sub classes.
 
 onInvalidControl ()
 Called if isValid () returns false To be override in sub classes.
 
 forward (string $controller, string $action='index', $params=[], bool $initialize=false, bool $finalize=false)
 Loads the controller $controller and calls its $action method by passing the parameters $params.
 
 redirectToRoute (string $routeName, $parameters=[], bool $initialize=false, bool $finalize=false)
 Redirect to a route by its name.
 
 getView ()
 Returns the associated view instance.
 
- Public Member Functions inherited from MessagesTrait
 _getFiles ()
 
 _showSimpleMessage ($content, $type, $title=null, $icon="info", $timeout=NULL, $staticName=null, $closeAction=null, $toast=false)
 
- Public Member Functions inherited from CRUDControllerUtilitiesTrait
 loadView (string $viewName, $pData=null, bool $asString=false)
 
 _getAdminData ()
 
 _getFiles ()
 
- Public Member Functions inherited from InsertJqueryTrait
 _insertJquerySemantic ()
 
- Public Member Functions inherited from HasModelViewerInterface
 _getAdminData ()
 
 _getFiles ()
 

Data Fields

string $resource = ''
 
- Data Fields inherited from InsertJqueryTrait
 $jquery
 

Protected Member Functions

 onRenderView (array &$data)
 To override.
 
 hasNavigation ()
 To override Return true for adding a navigation dropdown menu.
 
 getRouteNamePrefix ()
 
 nav (?array $models=null, string $btIcon='chevron right', string $btTitle='Navigate to...', bool $asString=true)
 
 getIndexModels ()
 
 getIndexModelsDetails ()
 
 getIndexDefaultIcon (string $resource)
 
 getIndexDefaultTitle (string $resource)
 
 getIndexDefaultDesc (string $modelClass)
 
 getIndexDefaultUrl (string $resource)
 
 getIndexDefaultMeta (string $modelClass)
 
 addIndexBehavior ()
 
 getIndexType ()
 
 getModelName ()
 
- Protected Member Functions inherited from CRUDController
 refreshAsJson ($instances)
 Return a JSON representation of $instances for the JsonDataTable component.
 
- Protected Member Functions inherited from MessagesTrait
 _getModelViewer ()
 
 showSimpleMessage_ (CRUDMessage $message, $staticName=null, $toast=false)
 
 showConfMessage_ (CRUDMessage $message, $url, $responseElement, $data, $attributes=NULL)
 
 _showConfMessage ($content, $type, $title, $icon, $url, $responseElement, $data, $attributes=NULL)
 
- Protected Member Functions inherited from CRUDControllerUtilitiesTrait
 showSimpleMessage_ (CRUDMessage $message, $staticName=null)
 
 showConfMessage_ (CRUDMessage $message, $url, $responseElement, $data, $attributes=null)
 
 getInstances (&$totalCount, $page=1, $id=null)
 
 search ($model, $search)
 
 updateMemberDataElement ($member, $instance)
 
 _edit ($instance, $modal="no")
 
 _showModel ($id=null)
 
 _deleteMultiple ($data, $action, $target, $condition, $params=[])
 Helper to delete multiple objects.
 
 refreshInstance ($instance, $isNew)
 
 getAdminData ()
 To override for defining a new adminData.
 
 getModelViewer ()
 To override for defining a new ModelViewer.
 
 _getModelViewer ()
 
 getFiles ()
 To override for changing view files.
 
 getEvents ()
 To override for changing events.
 
 getInstanceToString ($instance)
 

Private Attributes

 $displayedItems = []
 
 $_hasDropdown = false
 

Additional Inherited Members

- Protected Attributes inherited from CRUDController
 $model
 
 $activePage =1
 
 $style
 
- Protected Attributes inherited from ControllerBase
string $headerView = '@activeTheme/main/vHeader.html'
 
string $footerView = '@activeTheme/main/vFooter.html'
 
- Protected Attributes inherited from Controller
View $view
 
- Protected Attributes inherited from CRUDControllerUtilitiesTrait
 $modelViewer
 
 $adminDatas
 
 $events
 
 $crudFiles
 

Detailed Description

Definition at line 22 of file MultiResourceCRUDController.php.

Member Function Documentation

◆ _getBaseRoute()

_getBaseRoute ( )
abstract

Reimplemented from CRUDControllerUtilitiesTrait.

◆ addIndexBehavior()

addIndexBehavior ( )
protected

Definition at line 128 of file MultiResourceCRUDController.php.

◆ getIndexDefaultDesc()

getIndexDefaultDesc ( string  $modelClass)
protected

Definition at line 116 of file MultiResourceCRUDController.php.

◆ getIndexDefaultIcon()

getIndexDefaultIcon ( string  $resource)
protected

Definition at line 108 of file MultiResourceCRUDController.php.

◆ getIndexDefaultMeta()

getIndexDefaultMeta ( string  $modelClass)
protected

Definition at line 124 of file MultiResourceCRUDController.php.

◆ getIndexDefaultTitle()

getIndexDefaultTitle ( string  $resource)
protected

Definition at line 112 of file MultiResourceCRUDController.php.

◆ getIndexDefaultUrl()

getIndexDefaultUrl ( string  $resource)
protected

Definition at line 120 of file MultiResourceCRUDController.php.

◆ getIndexModels()

getIndexModels ( )
protected

Definition at line 100 of file MultiResourceCRUDController.php.

◆ getIndexModelsDetails()

getIndexModelsDetails ( )
protected

Definition at line 104 of file MultiResourceCRUDController.php.

◆ getIndexType()

getIndexType ( )
protected

Definition at line 141 of file MultiResourceCRUDController.php.

◆ getModelName()

getModelName ( )
protected

Definition at line 145 of file MultiResourceCRUDController.php.

◆ getRouteNamePrefix()

getRouteNamePrefix ( )
protected

Definition at line 83 of file MultiResourceCRUDController.php.

◆ hasNavigation()

hasNavigation ( )
protected

To override Return true for adding a navigation dropdown menu.

Returns
bool

Definition at line 79 of file MultiResourceCRUDController.php.

◆ home()

home ( )

Definition at line 35 of file MultiResourceCRUDController.php.

◆ initialize()

initialize ( )

Method called before each action Can be override in derived class.

Reimplemented from ControllerBase.

Definition at line 30 of file MultiResourceCRUDController.php.

◆ nav()

nav ( ?array  $models = null,
string  $btIcon = 'chevron right',
string  $btTitle = 'Navigate to...',
bool  $asString = true 
)
protected

Definition at line 87 of file MultiResourceCRUDController.php.

◆ onRenderView()

onRenderView ( array &  $data)
protected

To override.

Parameters
array$data

Definition at line 70 of file MultiResourceCRUDController.php.

◆ showDetail()

showDetail (   $ids)

Shows associated members with foreign keys.

Parameters
mixed$ids

Reimplemented from CRUDController.

Definition at line 151 of file MultiResourceCRUDController.php.

◆ showModelClick()

showModelClick (   $modelAndId)

Definition at line 160 of file MultiResourceCRUDController.php.

Field Documentation

◆ $_hasDropdown

$_hasDropdown = false
private

Definition at line 28 of file MultiResourceCRUDController.php.

◆ $displayedItems

$displayedItems = []
private

Definition at line 26 of file MultiResourceCRUDController.php.

◆ $resource

string $resource = ''

Definition at line 24 of file MultiResourceCRUDController.php.


The documentation for this class was generated from the following file: