websonette / web-application
Framework-independent page context, breadcrumbs, and shared web application state.
Requires
- php: ^8.3
Requires (Dev)
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-24 06:34:34 UTC
README
Framework-independent request-scoped state shared by Websonette application adapters.
The package is currently being prepared and does not have a stable public API yet.
Scope
The package contains data and operations only. It does not depend on Nette, Latte, React, HTML, sessions, or a particular response format.
Websonette\WebApplication\Breadcrumbs\Breadcrumbsmanages an ordered breadcrumb trail identified by URL.Websonette\WebApplication\Page\PageContextdescribes the current page and exposes a serializable SPA-friendly contract.
Rendering and framework integration belong to adapter packages such as websonette/latte-application and the Nette/Contributte Apitte plus React adapter websonette/react-spa-application.
The repository also carries development tooling without coupling it to the runtime:
contracts/contains versioned JSON Schemas for PageContext, breadcrumbs, and their SPA application envelope;docs/standards/defines standards common to all Websonette web projects;skills/contains adapter-neutral Cursor workflows for creating, updating, and auditing projects;- adapter repositories own their project profiles and framework-specific references.
See Architecture and Project profiles. The dependency direction remains project -> adapter -> web-application.
Breadcrumbs
use Websonette\WebApplication\Breadcrumbs\Breadcrumbs; $breadcrumbs = new Breadcrumbs(); $breadcrumbs->add('Homepage', '/', 'home', 'Introduction'); $breadcrumbs->add('Products', '/products', 'box');
Page context
use Websonette\WebApplication\Page\PageContext; $page = (new PageContext()) ->setTitle('Products') ->setHeading('Our products') ->setDescription('Product overview') ->setCanonicalUrl('https://example.com/products') ->addAlternateUrl('cs', 'https://example.com/cs/produkty') ->setProperty('og:title', 'Products');
Both services provide toArray() output suitable for a framework-specific JSON response.
For an SPA response, use the versioned envelope defined by contracts/application-context.schema.json:
return new JsonResponse([ 'contractVersion' => 1, 'page' => $page->toArray(), 'breadcrumbs' => $breadcrumbs->toArray(), ]);
Installation
After the first release and Packagist registration:
composer require websonette/web-application
License
Websonette Web Application is licensed under the MIT License.