Ubiquity 2.5.2
php rapid development framework
|
Ubiquity\controllers\crud$CRUDController This class is part of Ubiquity. More...
Public Member Functions | |
__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. | |
showDetail ($ids) | |
Shows associated members with foreign keys. | |
detailClick ($url, $responseElement='#divTable', $attributes=["attr"=> "data-ajax"]) | |
Public Member Functions inherited from ControllerBase | |
initialize () | |
Method called before each action Can be override in derived class. | |
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 CRUDControllerUtilitiesTrait | |
loadView (string $viewName, $pData=null, bool $asString=false) | |
_getBaseRoute () | |
_getAdminData () | |
_getFiles () | |
Public Member Functions inherited from InsertJqueryTrait | |
_insertJquerySemantic () | |
Public Member Functions inherited from HasModelViewerInterface | |
_getAdminData () | |
_getBaseRoute () | |
_getFiles () | |
Protected Member Functions | |
refreshAsJson ($instances) | |
Return a JSON representation of $instances for the JsonDataTable component. | |
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) | |
Protected Attributes | |
$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 | |
Additional Inherited Members | |
Data Fields inherited from InsertJqueryTrait | |
$jquery | |
Ubiquity\controllers\crud$CRUDController This class is part of Ubiquity.
Definition at line 26 of file CRUDController.php.
__construct | ( | ) |
Constructor initialize $view variable.
Reimplemented from Controller.
Definition at line 31 of file CRUDController.php.
_setStyle | ( | $elm | ) |
Reimplemented from CRUDControllerUtilitiesTrait.
Definition at line 50 of file CRUDController.php.
delete | ( | $ids | ) |
Deletes an instance.
mixed | $ids | @route("methods"=>["post","get"]) |
Definition at line 224 of file CRUDController.php.
detailClick | ( | $url, | |
$responseElement = '#divTable' , |
|||
$attributes = [ "attr" => "data-ajax"] |
|||
) |
Definition at line 343 of file CRUDController.php.
display | ( | $modal = "no" , |
|
$ids = "" |
|||
) |
Displays an instance.
string | $modal | |
string | $ids |
Definition at line 201 of file CRUDController.php.
edit | ( | $modal = "no" , |
|
$ids = "" |
|||
) |
Edits an instance.
string | $modal | Accept "no" or "modal" for a modal dialog |
string | $ids | the primary value(s) |
Definition at line 147 of file CRUDController.php.
editMember | ( | $member | ) |
$member |
Exception
Definition at line 183 of file CRUDController.php.
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.
Reimplemented from Controller.
Definition at line 65 of file CRUDController.php.
newModel | ( | $modal = "no" | ) |
Adds a new instance and edits it.
string | $modal | Accept "no" or "modal" for a modal dialog |
Definition at line 163 of file CRUDController.php.
refresh_ | ( | ) |
Refreshes the area corresponding to the DataTable.
Definition at line 115 of file CRUDController.php.
|
protected |
Return a JSON representation of $instances for the JsonDataTable component.
array | $instances |
Definition at line 43 of file CRUDController.php.
refreshTable | ( | $id = null | ) |
Definition at line 256 of file CRUDController.php.
showDetail | ( | $ids | ) |
Shows associated members with foreign keys.
mixed | $ids |
Reimplemented in MultiResourceCRUDController.
Definition at line 307 of file CRUDController.php.
updateMember | ( | $member, | |
$callback = false |
|||
) |
$member | ||
boolean | $callback |
Exception
Definition at line 84 of file CRUDController.php.
updateModel | ( | ) |
Updates an instance from the data posted in a form.
Definition at line 271 of file CRUDController.php.
|
protected |
Definition at line 28 of file CRUDController.php.
|
protected |
Definition at line 27 of file CRUDController.php.
|
protected |
Definition at line 29 of file CRUDController.php.