--- /dev/null
+<?php
+
+
+namespace Cubist\Backpack\app\Http\Controllers;
+
+trait CubistCrud
+{
+ public function addField($field, $form = 'both')
+ {
+ if (isset($field['column_label']) || isset($field['column']) && $field['column'] == true) {
+ $column_data = ['name' => $field['name'], 'label' => $field['label'], 'type' => 'text'];
+ if (isset($field['column'])) {
+ unset($field['column']);
+ }
+ if (isset($field['column_label'])) {
+ $column_data['label'] = $field['column_label'];
+ unset($field['column_label']);
+ }
+ if (isset($field['column_type'])) {
+ $column_data['type'] = $field['column_type'];
+ unset($column_data['type']);
+ }
+ $this->crud->addColumn($column_data);
+ }
+ $this->crud->addField($field, $form);
+ }
+}
+++ /dev/null
-<?php
-
-
-namespace Cubist\Backpack\app\Http\Controllers;
-
-trait CubistCrudController
-{
- public function addField($field, $form = 'both')
- {
- if (isset($field['column_label']) || isset($field['column']) && $field['column'] == true) {
- $column_data = ['name' => $field['name'], 'label' => $field['label'], 'type' => 'text'];
- if (isset($field['column'])) {
- unset($field['column']);
- }
- if (isset($field['column_label'])) {
- $column_data['label'] = $field['column_label'];
- unset($field['column_label']);
- }
- if (isset($field['column_type'])) {
- $column_data['type'] = $field['column_type'];
- unset($column_data['type']);
- }
- $this->crud->addColumn($column_data);
- }
- $this->crud->addField($field, $form);
- }
-}
*/
class CubistModelCrudController extends CrudController
{
- use CubistCrudController;
+ use CubistCrud;
public function setup()
{
class CubistPageCrudController extends PageCrudController
{
+ use CubistCrud;
protected static $_templates = null;
/**
/**
* Add the fields defined for a specific template.
*
- * @param string $template_name The name of the template that should be used in the current form.
+ * @param string $template_name The name of the template that should be used in the current form.
*/
public function useTemplate($template_name = false)
{