PHP code example of niyko / rocket

1. Go to this page and download the library: Download niyko/rocket 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/ */

    

niyko / rocket example snippets




iyko\Rocket\Rocket;

Rocket::init();

// A sample page is added like this
Rocket::page('sample')->url('/')->view('sample')->add();

// Here is an example page added with long url
Rocket::page('contact')->url('/about/contact')->view('contact-page')->add();

// Here is an example page added with URL paramters
Rocket::page('blog.inner')
    ->url('/blog/{slug}', ['slug' => 'sample-blog-1'])
    ->view('blog-inner-page')
    ->add();

// Here is an example page with view parameters
Rocket::page('blog.inner')
    ->url('/blog/{slug}', ['slug' => 'sample-blog-2'])
    ->view('blog-inner-page', ['title' => 'Sample blog two'])
    ->add();

Rocket::start();



iyko\Rocket\Rocket;

Rocket::init();

Rocket::page('blog.inner')
    ->url('/blog/{slug}', ['slug' => 'sample-blog-1'])
    ->view('blog-inner-page', ['title' => 'Sample blog one'])
    ->add();

Rocket::start();



iyko\Rocket\Rocket;

Rocket::init();

Rocket::page('about')->url('/about')->view('about-page')->add();

Rocket::page('contact')->url('/about/contact')->view('contact-page')->add();

Rocket::page('blog.inner')
    ->url('/blog/{slug}', ['slug' => 'sample-blog-1'])
    ->view('blog-inner-page', ['title' => 'Sample blog one'])
    ->add();

Rocket::start();
`

**:page_facing_up: views/about-page.blade.php**