Ejemplo n.º 1
0
 public function create()
 {
     if (count($_POST) > 0) {
         $model = $this->model;
         $model = $model::create();
         if ($model->validate($_POST)) {
             $model->save();
             header("Location: {$this->url}");
             exit;
         }
     }
     $form = \Gravel\Scaffolding::createInsertForm($this->table, $this->model);
     $this->loadView('utilities/genericCreate', compact('form'));
 }
Ejemplo n.º 2
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('brands', 'Brand');
?>
@endsection
Ejemplo n.º 3
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('blog_posts', 'Blog');
?>
@endsection
Ejemplo n.º 4
0
<?php

use Gravel\Scaffolding;
?>

@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('users', 'User');
?>
@endsection