mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-22 07:54:11 -05:00
Name the columns key for both the view and edit lists 'columns'
This commit is contained in:
parent
b900f56b71
commit
a5f8d2aa78
3 changed files with 7 additions and 15 deletions
|
@ -42,7 +42,7 @@ class DashboardController extends Controller {
|
||||||
'heading' => 'Contact Form Submissions',
|
'heading' => 'Contact Form Submissions',
|
||||||
'model' => 'contact',
|
'model' => 'contact',
|
||||||
'rows' => Contact::getContactSubmissions(),
|
'rows' => Contact::getContactSubmissions(),
|
||||||
'cols' => Contact::$dashboard_columns
|
'columns' => Contact::$dashboard_columns
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class DashboardController extends Controller {
|
||||||
'heading' => 'Subscriptions',
|
'heading' => 'Subscriptions',
|
||||||
'model' => 'subscriptions',
|
'model' => 'subscriptions',
|
||||||
'rows' => Subscriptions::getSubscriptions(),
|
'rows' => Subscriptions::getSubscriptions(),
|
||||||
'cols' => Subscriptions::$dashboard_columns
|
'columns' => Subscriptions::$dashboard_columns
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
readme.md
14
readme.md
|
@ -40,7 +40,7 @@ First add a function to generate the page:
|
||||||
'heading' => 'Contact Form Submissions',
|
'heading' => 'Contact Form Submissions',
|
||||||
'model' => 'contact',
|
'model' => 'contact',
|
||||||
'rows' => Contact::getContactSubmissions(),
|
'rows' => Contact::getContactSubmissions(),
|
||||||
'cols' => Contact::$dashboard_columns
|
'columns' => Contact::$dashboard_columns
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -48,7 +48,7 @@ First add a function to generate the page:
|
||||||
* `heading`: The title that will appear for this page
|
* `heading`: The title that will appear for this page
|
||||||
* `model`: The model that will be accessed on this page
|
* `model`: The model that will be accessed on this page
|
||||||
* `rows`: A function returning an array containing the data to be shown on this page
|
* `rows`: A function returning an array containing the data to be shown on this page
|
||||||
* `cols`: Expects a variable called `$dashboard_columns` in the respective model that contains an array:
|
* `columns`: Expects a variable called `$dashboard_columns` in the respective model that contains an array:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
public static $dashboard_columns = [
|
public static $dashboard_columns = [
|
||||||
|
@ -143,15 +143,7 @@ This function should be named the same as the one above except with `Edit` at th
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'item' => $item,
|
'item' => $item,
|
||||||
'help_text' => '<strong>NOTE:</strong> This is some help text for the current page',
|
'help_text' => '<strong>NOTE:</strong> This is some help text for the current page',
|
||||||
'columns' => [
|
'columns' => $dashboard_columns
|
||||||
[ 'name' => 'venue', 'type' => 'text' ],
|
|
||||||
[ 'name' => 'date', 'type' => 'date' ],
|
|
||||||
[ 'name' => 'address', 'type' => 'text' ],
|
|
||||||
[ 'name' => 'phone', 'type' => 'text' ],
|
|
||||||
[ 'name' => 'website', 'type' => 'text' ],
|
|
||||||
[ 'name' => 'cover', 'type' => 'text' ],
|
|
||||||
[ 'name' => 'description', 'type' => 'mkd' ]
|
|
||||||
]
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="heading-row">
|
<tr class="heading-row">
|
||||||
@foreach($cols as $column)
|
@foreach($columns as $column)
|
||||||
<th>{{ $column[0] }}</th>
|
<th>{{ $column[0] }}</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($rows as $row)
|
@foreach($rows as $row)
|
||||||
<tr>
|
<tr>
|
||||||
@foreach($cols as $column)
|
@foreach($columns as $column)
|
||||||
<td><strong class="mobile-heading">{{ $column[0] }}: </strong>{{ $row[$column[1]] }}</td>
|
<td><strong class="mobile-heading">{{ $column[0] }}: </strong>{{ $row[$column[1]] }}</td>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in a new issue