oziScript
oziScript App

Welcome to oziScript

You are looking at the sample landing page. Scroll down for a guided tour of how oziScript works, then edit components/index.php to make it yours.

How a page is assembled

One URL → one screen file → one view function → one component that prints widgets.

1. URL

The pretty URL decides the screen. Everything after the screen name becomes $_GET pairs.

/about/productId/123
2. Screen

A tiny router file. It just calls the screen's view function. That's all.

<?php about(); ?>
3. View

Registered in view.php. Connects a screen name to a component file.

function about() {
require "components/about.php";
}
4. Component

Your UI. Call widgets in order. This page is such a component.

ozi_nav_simple(...);
ozi_hero_modern(...);

Make your first page in 3 steps

1
Create the screen (CLI wires route + view + component)
php ozi screen about create
2
Open components/about.php and assemble widgets
<?php
ozi_nav_simple(brand: "My App", links: ["Home" => linkTo("homepage")]);
ozi_hero_modern(title: "Hello!", desc: "My first oziScript page.");
ozi_footer_clean(copyright: "My App");
?>
3
Visit it
http://localhost:3000/about

Need a different widget? php ozi widget list then php ozi widget <name> install.

Pretty URLs & parameters

linkTo("about&&productId=123") generates /about/productId/123, and the router puts productId=123 into $_GET automatically.

<?php
// Link ...
echo linkTo("about&&productId=123"); // /about/productId/123

// ... and on the destination component:
echo $_GET['productId']; // 123
?>
Back to top
Device Bridge (live)

OziDevice is available on every page - one API for Web, PWA, Electron, Capacitor and native Android. This card reads it with a few lines of vanilla JS.

  • Running on: Linux x86_64
  • Online: offline
  • Version: 1.0.0

Calling your backend as JSON

Cores in system_files/api/ become raw JSON endpoints at /api/<name>. Native apps, scripts and this page all use the same endpoint. Try it - the result of the ping endpoint appears below.

// system_files/api/ping.php  (already shipped with the framework)
api_require_method("GET", "POST");
api_response(["status" => "ok", "name" => ozi_app_config("name")]);
Click the button to see live JSON.