Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a reference to setFromDb() #506

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a reference to setFromDb()
There does not appear to be any reference to this function in the documentation, however it appears in the setupListOperation() and setupCreateOperation() when creating a CrudController, so I added a description (adapted from setFromDb() in AutoSet.php)
  • Loading branch information
peterhauke authored Aug 31, 2023
commit 30d003dc872fb177c8d5b59f680e3b1abcb91fb4
6 changes: 6 additions & 0 deletions 6.x/crud-api.md
Original file line number Diff line number Diff line change
@@ -65,6 +65,12 @@ $this->crud->setColumns();
// sets the columns you want in the table view, either as array of column names, or multidimensional array with all columns detailed with their types
```

- **setFromDb()** - use the public columns in the database table;
```php
$this->crud->setFromDb();
// for a simple CRUD Panel, there should be no need to add/define the fields/columns. The public columns in the database will be converted to be fields
```

- **Chained - beforeColumn()** - insert current column _before_ the given column
```php
// ------ REORDER COLUMNS