PHPackages                             ottophp/demo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ottophp/demo

ActiveLibrary

ottophp/demo
============

0.x-dev(4y ago)10PHP

Since Jan 10Pushed 4y ago3 watchersCompare

[ Source](https://github.com/ottophp/demo)[ Packagist](https://packagist.org/packages/ottophp/demo)[ RSS](/packages/ottophp-demo/feed)WikiDiscussions 0.x Synced 3w ago

READMEChangelogDependencies (3)Versions (1)Used By (0)

Otto Project
============

[](#otto-project)

Prerequisite
------------

[](#prerequisite)

Do a global search-and-replace on the string `__PROJECT__` to replace it with the top-level namespace for your project.

Application Services
--------------------

[](#application-services)

Create Application Service classes in the `src/Domain/App/` directory. Use the `__invoke()` method as the main method.

The `__invoke()` method should always-and-only return a Domain Payload; cf. `src/Domain/Payload.php`.

The `App::run()` method is a wrapper around the `__invoke()` main method to catch exceptions from the domain and report them as errors.

Actions and Action Templates
----------------------------

[](#actions-and-action-templates)

You can create an action and its corresponding template like so:

`php bin/otto-action.php {$VERB} {$PATH} {$DOMAIN}`

- `{$VERB}` is an HTTP verb; e.g. `GET`
- `{$PATH}` is the URL path leading to the action, with dynamic placeholders as needed; e.g. `/user/{userId}`
- `{$DOMAIN}` is a domain subclass, e.g. `App\\User\\FetchUser`

Calling the above command will create an Action in the right place (in this case, `src/Sapi/Http/Action/User/GetUser.php`) with an html template in the right place (`resources/responder/html/action/User/GetUser.php`).

You will then need to edit the new Action class to set the typehints on the parameters (if any), and touch up the Domain call to add or modify any needed arguments.

If you decide that the basic action class template is not suitable for your purposes, edit `resources/action.tpl` as you see fit.

Other Templates
---------------

[](#other-templates)

All templates are in `resources/responder/{$FORMAT}`, where `{$FORMAT}` is `html` or `json`.

Layout templates are in the `{$FORMAT}/layout/` subdirectory. For HTML, these provide the common site wrapper display. For JSON, this provides a final chance to manipulate the template variables that will be JSON-encoded for the Response.

Status templates are in the `{$FORMAT}/status/` subdirectory. These are used when a domain payload is present but an action-specific template. The payload status will determine which status template is used.

Front templates (for presenting uncaught Throwables) are in the `{$FORMAT}/front/` subdirectory. Front templates are named for the Throwable class they will display. If the specific Throwable does not have a template, Otto will try its parent class, then *its* parent class, and so on, until it reaches the topmost parent class(either `Exception` or `Error`).

In general, you should not depend on the front templates too much for Throwable presentation. Instead, your Application Service should return Payload objects with an `ERROR` status, and your action or status templates should present those errors appropriately.

Summary
-------

[](#summary)

Overall, the vast majority of your work should *not* be in the action.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1634d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

---

Top Contributors

[![pmjones](https://avatars.githubusercontent.com/u/25754?v=4)](https://github.com/pmjones "pmjones (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ottophp-demo/health.svg)

```
[![Health](https://phpackages.com/badges/ottophp-demo/health.svg)](https://phpackages.com/packages/ottophp-demo)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
