Download the PHP package niyko/rocket without Composer
On this page you can find all versions of the php package niyko/rocket. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package rocket
Short Description Rocket is a static site generator written in PHP which uses Laravel's Blade template engine under the hood to generate build.
License MIT
Informations about the package rocket
Rocket is a static site generator written in PHP which uses Laravel's Blade template engine under the hood to build static websites. Rocket automates the task of coding individual HTML pages and gets those pages ready to serve to users ahead of time. Because these HTML pages are pre-built, they can load very quickly in the browser.
:tophat: Requirments
The Rocket framework has a few system requirements. You should ensure that your local system has the following minimum PHP version and extensions:
- PHP >=
8.0.0
- Composer >=
1.0.0
:zap: Get started
Rocket framework can be installed from the composer package manager. Make sure you installed PHP and Composer from the requirments section before continuing with the steps given below.
- Create a project folder and open a command prompt inside that folder.
- Run the command
composer require niyko/rocket
to install the plugin. - To setup the project, run the command
php vendor/niyko/rocket/src/Console/Console.php --ansi create
- Explore the sample project that is copied to the project folder.
- Run the sample project with the command
composer rocket dev
. - Open the URL shown on the command prompt in the browser.
You can change the files in the project and reload the browser to view change. Restarting the development server is not required.
:open_file_folder: Project structure
This project struture shows where is all the different files are located. An overview of the folder structure of a Rocket application. It covers top-level files and folders, configuration files, and routing conventions.
/index.php
file contains routes for the pages./views
folder contains the blade files of the pages./assets
folder containsimages/css/js
and other assets for the pages./dist
folder contains generated static website when a build is created./build
folder contains a zip file of the build generated.
:pushpin: Creating page routes
Pages of the website is added in the file called index.php
, which are located in the root of the project directory. In this file we can add the page urls and the views that should be loaded for each page. Here is an example of the index.php
file.
`
:page_facing_up: views/blog-inner-page.blade.php ``
:card_file_box: Using assets
Assets like images, css, javascript etc are stored in the assets
folder in the root of the project. You can use the asset()
function in blade to link the assets. File cache parameters are managed automatically by the framework. Here is a example of the asset()
function.
:page_facing_up: views/sample.blade.php ``
:link: Linking to other pages
In Rocket framework we can use the function page()
to create a link of other pages. Which can be used into <a>
links are other methods. Basically page()
function create a link to the page using the route given in index.php
file. Here is an example given using below.
:page_facing_up: index.php ``html
About
Go to contact us Go to sample blog page
### :package: Production build
Running `composer rocket build` generates an optimized version of your application for production. HTML, CSS, and JavaScript files are created based on your pages. This build is stored in the `dist` folder and a zipped version of the same is saved in the `build` folder.
### :rocket: Deploying
As the final output of the build is a static HTML based website, you can use them in anyway you want. To test the build, you can use the command `composer rocket run`. Which will create a server which runs the static files created in the build.
> `composer rocket run` should not be used to host the build in production. This command should only be used for testing purpose. It is recommended to use `Ngnix` or `Apache` as a server in production.
### :page_with_curl: License
Rocket is licensed under the [MIT License](https://github.com/Niyko/Rocket/blob/master/LICENSE).
All versions of rocket with dependencies
symfony/var-dumper Version ^6.4
eftec/bladeone Version ^4.13
spatie/ignition Version ^1.14
symfony/console Version ^6.4
symfony/filesystem Version ^6.4
nelexa/zip Version ^4.0
statix/server Version ^0.5.0
nicmart/string-template Version ^0.1.3
dfridrich/php-mime-type Version ^3.0