PHP code example of spatian-dev / ziglite

1. Go to this page and download the library: Download spatian-dev/ziglite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spatian-dev / ziglite example snippets


$this->app->register(\Spatian\Ziglite\Providers\ZigliteServiceProvider::class);

use Spatian\Ziglite\Routes\Manifest;

new Manifest(["*", "!admin.*", "!api.*"]);

// in blade
@ziglite(["*", "!admin.*", "!api.*"]);

use Spatian\Ziglite\Routes\Manifest;

new Manifest(); // No routes .*", "!api.*"]); // A list of patterns

use Spatian\Ziglite\Routes\Manifest;

new Manifest(base: 'https://example.test');

use Spatian\Ziglite\Routes\Manifest;

Manifest::clearRoutes();

use Spatian\Ziglite\Routes\Manifest;

json_encode(new Manifest());
(new Manifest())->toJson();

// home.blade.php
@ziglite("*")

make(array|string $filters = [], string $base = null, string $nonce = ''): string

app('ziglite')->setupBladeDirective('mydirective', new MyCustomOutputGenerator());
javascript
import { route } from 'ziglite';
/*
    Given a route named 'users.show' defined as /{locale}/users/{user},
    and configured route default ['locale' => 'en']
*/
route('users.show', {user: 5}); // https://example.test/en/users/5