Exemplo n.º 1
0
 public function update($id = null)
 {
     $model = $this->model;
     $id = $id;
     if (count($_POST) > 0) {
         $record = $model::find($id);
         if ($record->validate($_POST)) {
             $record->save();
             header("Location: {$this->url}");
             exit;
         }
     }
     $form = \Gravel\Scaffolding::createEditForm($this->table, $this->model, $id);
     $this->loadView('utilities/genericUpdate', compact('form'));
 }
Exemplo n.º 2
0
 public function update($id = null)
 {
     $id = $id;
     $user = User::find($id);
     if (count($_POST) > 0) {
         $password = $user->password;
         if ($user->validate($_POST)) {
             if ($password !== $user->password) {
                 $user->password = sha1($user->password);
             }
             $user->save();
             header("Location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
     }
     $form = \Gravel\Scaffolding::createEditForm($this->table, $this->model, $id);
     $this->loadView('utilities/genericUpdate', compact('id', 'user', 'form'));
 }
Exemplo n.º 3
0
<?php

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

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

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

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createEditForm('users', 'User', $id);
?>
@endsection
Exemplo n.º 7
0
<?php

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

use Gravel\Scaffolding;
?>

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