Repository navigation
API Controller
Caligrafy Quill 2.26.0. Generated from the source by
php qa/build-api-reference.php; the guides explain how to use these classes, this reference says exactly what each public method takes and returns. Back to the API reference.
Part of Controllers and views.
namespace Caligrafy;
class Controller extends \stdClassSource: framework/core/Controller.php:19
Parent Class that defines the properties and methods of a controller
->__construct()->__invoke()->activatePayment()->associate()->index()->all()->find()->save()->delete()->search()->table()->check()->validate()->filter()->view()->api()->call()
public function __construct($modelname = '', $table = null)No doc comment.
Parameters
-
$modelname, default'' -
$table, defaultnull
Source: framework/core/Controller.php:28
public function __invoke($modelname, $table)No doc comment.
Parameters
$modelname$table
Source: framework/core/Controller.php:33
public function activatePayment()Activates a the Stripe Payment module
Source: framework/core/Controller.php:64
public function associate($modelname, $table)Associates a controller with a model optionally with a table in the database
Parameters
$modelname$table
Source: framework/core/Controller.php:73
public function index()Implied default function that will run when no action has been determined at runtime
Source: framework/core/Controller.php:82
public function all($args = array())Basic common CRUD function that fetches all data from the associated table
Parameters
-
$args, defaultarray()
Source: framework/core/Controller.php:88
public function find($id = null)Basic common CRUD function that finds a particular record
Parameters
-
$id, defaultnull
Source: framework/core/Controller.php:96
public function save($inputs, $id = null)Basic common CRUD function that saves data to the database whether adding a new record or updating an existing one
Parameters
$inputs-
$id, defaultnull
Source: framework/core/Controller.php:104
public function delete($id = null)Basic common CRUD function that deletes a record from the database
Parameters
-
$id, defaultnull
Source: framework/core/Controller.php:114
public function search($scope = null, $keywords = null)No doc comment.
Parameters
-
$scope, defaultnull -
$keywords, defaultnull
Source: framework/core/Controller.php:120
public function table()Gets the table that is associated with a model
Source: framework/core/Controller.php:131
public function check($data, $rules = array(), $filters = array())Filtering and Validation through a controller
Parameters
$data-
$rules, defaultarray() -
$filters, defaultarray()
Source: framework/core/Controller.php:139
public function validate($data, $rules)Validation through a controller
Parameters
$data$rules
Source: framework/core/Controller.php:147
public function filter($data, $filters)Filtering through a controller
Parameters
$data$filters
Source: framework/core/Controller.php:156
public function view($viewName, $viewData = array())return a Pug template view with viewData passed to it
Parameters
$viewName-
$viewData, defaultarray()
Source: framework/core/Controller.php:165
public function api($viewData = array())return a view consumable by APIs
Parameters
-
$viewData, defaultarray()
Source: framework/core/Controller.php:173
public function call($name, $input = null)Calls a capability as the signed-in user (web pages): the same rules as REST and MCP
try { $book = $this->call('create_book'); redirect('/books/' . $book['id']); }
catch (ServiceError $e) { return view('Books/form', ['errors' => $e->fields]); }
Parameters
-
$namestring: the capability -
$inputarray|null, defaultnull: the inputs (default: the request parameters and the route variables)
Returns mixed: plain data
- @throws ServiceError
Caligrafy: Describe it. Approve it. Ship it. Your idea turned into a complete app: every feature built once, for web pages, Vue apps, a REST API and AI agents, and online.
Why Caligrafy: the benefits, the measurements, and what it is not yet
-
Quickstart with Claude: describe it, approve it, ship it
or the Quickstart: the same three steps by hand, in 5 minutes
- How Caligrafy works: the ideas in 5 minutes
- Your first capability: build a feature, page included
-
Capabilities in depth
-
#[Capability]: every option - Scheduled jobs: capabilities on a timer
- Notifications: web push and email
- Background jobs: capabilities run later
- Migrations: database changes, in order
- The cache
-
Testing your app
- Dependency injection
- Validation rules
-
Web pages
- Views and page components
- Design styles: another look, one setting
- Declarative routes: every request, in one line
-
Route::page·Route::form·Route::auth·Route::webhook·Route::download·Route::redirect·Route::action·Route::snap· capability routes - How to export a list as CSV
- Controllers: moving one to a declared route · how to, step by step
- Forms and helpers
-
Vue apps
-
Mobile and tablet
-
REST API
-
AI agents
-
Snap Cards and the assistant
- Payments: Stripe and crypto
- Face detection and face login
- OpenAI: chat and images · Assistants
- Open models: Llama, Mistral...
- Chatbots with Watson
- Machine learning in the browser
- Metadata and social cards · search and analytics
-
Putting it online: the production image, the database at every start
-
API reference: every class and method
-
Routing ·
Route·AuthRoutes· pages ·Controller· capabilities -
Data ·
Model·Query· sign-in · jobs ·Notify· payments · AI -
Interfaces · Snap ·
Snap\Cards·Snap\Conversation· testing · tooling · helper functions
-
Routing ·
-
Caligrafer: every command
- Project · build · data · agents · jobs and tests · maintenance · deploy
- Installation, configuration and Caligrafer
- Routing · Request · Controllers · Views
- Vue: flow of information · routes · validations
- Security and upgrading
- Release notes: 2.26 · 2.25 · 2.24 · 2.23 · 2.22 · 2.21 · 2.20 · 2.19 · 2.18 · 2.17 · 2.16 · 2.15 · 2.14 · 2.13 · 2.12 · 2.11 · 2.10 · 2.9 · 2.8 · 2.7 · 2.6 · 2.5 · 2.4 · 2.3 · 2.1 · October 2026 · changelog
- Testing Caligrafy (contributors)