Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
documentation:rack:reference:views [2018/05/26 16:37] – Martijn Luinstra | documentation:rack:reference:views [2019/05/10 17:55] – Document ModelView->run_csv() behaviour Martijn Luinstra |
---|
<php>ModelView</php> inherits all properties from <php>FormView</php>. | <php>ModelView</php> inherits all properties from <php>FormView</php>. |
| |
* <php>protected $views</php> List of implemented views. Defaults to <php>['create', 'read', 'update', 'delete', 'list']</php>. | * <php>protected $views</php> List of implemented views. Defaults to <php>['create', 'read', 'update', 'delete', 'list']</php>. Additionally a view for export to CSV (<php>'csv'</php>) has been implemented, but is disabled by default. |
* <php>protected $default_view</php> The name of the view to run if the URL parameter <php>view</php> is not provided. Defaults to <php>"list"</php>. | * <php>protected $default_view</php> The name of the view to run if the URL parameter <php>view</php> is not provided. Defaults to <php>"list"</php>. |
* <php>protected $model</php> Contains the view's model object, but obsolete if you override <php>get_model()</php>. | * <php>protected $model</php> Contains the view's model object, but obsolete if you override <php>get_model()</php>. |
| |
* <php>public __construct($page_id, $title='', $model=null, $form=null)</php> | * <php>public __construct($page_id, $title='', $model=null, $form=null)</php> |
* <php>protected run_page()</php> It is not recommended to override this function unless you want to create additional views. Override <php>run_create()</php>, <php>run_read()</php>, <php>run_update()</php>, <php>run_delete()</php> and <php>run_list()</php> instead. | * <php>protected run_page()</php> It is not recommended to override this function unless you want to create additional views. Override <php>run_create()</php>, <php>run_read()</php>, <php>run_update()</php>, <php>run_delete()</php>, <php>run_list()</php> and <php>run_csv()</php> instead. |
* <php>protected run_create()</php> | * <php>protected run_create()</php> |
* <php>protected run_read()</php> | * <php>protected run_read()</php> |
* <php>protected run_delete()</php> | * <php>protected run_delete()</php> |
* <php>protected run_list()</php> | * <php>protected run_list()</php> |
| * <php>protected run_csv()</php> Disabled by default. Enable by overriding <php>$views</php> (add <php>'csv'</php>). |
| * <php>protected get_csv_data()</php> Provides dataset for <php>run_csv()</php> as associative array. |
* <php>protected process_form_data($data)</php> Creates or updates object in database. | * <php>protected process_form_data($data)</php> Creates or updates object in database. |
* <php>protected get_model()</php> | * <php>protected get_model()</php> |