PHP Classes

File: examples/library/www/author_edit.php

Recommend this page to a friend!
  Classes of Victor Bolshov   Tiny PHP ORM Framework   examples/library/www/author_edit.php   Download  
File: examples/library/www/author_edit.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Tiny PHP ORM Framework
Map objects to databases using composed queries
Author: By
Last change:
Date: 8 years ago
Size: 644 bytes
 

Contents

Class file image Download
<?php

use \library\Registry,
    \
library\Author;

include
__DIR__ . "/../bootstrap.php";

if (empty(
$_GET["id"])) {
    die(
"No author ID provided");
} else {
   
$author = Registry::persistenceDriver()->find((int) $_GET["id"], new Author());
    if (!
$author) {
        die(
"Author ID #" . (int) $_GET["id"] . " not found");
    }
}

echo \
library\View::render("header.php", [
   
"title" => "Tinyorm Library: Edit author",
   
"description" => \library\View::render("sidebar/author_edit.html"),
]);

echo \
library\View::render(
   
"author_edit.php",
    [
       
"author" => $author,
    ]
);

echo \
library\View::render("footer.php"); ?>