Esempio 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'));
 }
 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'));
 }
Esempio 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
Esempio n. 4
0
<?php

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

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

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

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

use Gravel\Scaffolding;
?>

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