Documentation

The most important thing to know is that CrudKit works and behaves as a full web application, and has frontend and backend functionality.

  • A user can load a single CrudKit App in a browser, by visiting a URL.
  • A single app contains one or more pages. Usually a page will be mapped to a single database table for editing.
  • The functionality and behaviour of the App is configured using the CrudKit PHP API written by you, the developer.
  • You will not be controlling or writing any HTML. You simply use the API to configure the behaviour and the UI will be generated via CrudKit.

Structure of a CrudKit App in PHP

This is an empty CrudKit application.:

<?php
// Require CrudKit application
require "crudkit/crudkit.php";
use CrudKit\CrudKitApp;
use CrudKit\Pages\HtmlPage;

// Create a new CrudKitApp object
$app = new CrudKitApp ();

// Create a new Page, of type "HtmlPage" which allows you to display arbitrary HTML inside 
$page = new HtmlPage("mypage1"); // Every page needs to have a unique ID
$page->setName ("My First Page"); // setName is available for all pages.
$page->setInnerHtml ("This is page # <b>1</b>"); // You can set the HTML of this page, a feature supported by HtmlPage
$app->addPage ($page);

$page2 = new HtmlPage("mypage2");
$page2->setName ("My Second Page");
$page2->setInnerHtml ("This is page # <b>2</b>");
$app->addPage ($page2);

// Render the app. This will display the HTML
$app->render ();

?>

If you open this in the browser, you will see a simple app with a single page.

Built by Anirudh Sanjeev. CrudKit is distributed under the MIT/X11 License.