https://github.com/amireshoon/luna
Luna is a simple very light class to render HTML pages or views or any files in PHP
https://github.com/amireshoon/luna
html-renderer php
Last synced: 10 months ago
JSON representation
Luna is a simple very light class to render HTML pages or views or any files in PHP
- Host: GitHub
- URL: https://github.com/amireshoon/luna
- Owner: amireshoon
- License: gpl-3.0
- Created: 2021-07-06T11:52:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-21T08:30:49.000Z (over 4 years ago)
- Last Synced: 2025-01-28T05:11:20.424Z (11 months ago)
- Topics: html-renderer, php
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Luna
Luna is a simple very light class to render HTML pages or views in PHP
# Instalation
You can install via composer or direclty copy the class or clone repo.
```bash
composer require amireshoon/luna
```
## Content format
You can render HTML pages or view or any context of any kind of file. You just have to include your keyword like this:
```
This is my {message} for you dear {name}.
```
or in html format your content should be like this:
```html
{title}
This is my {message} for you dear {name}
```
## Usage
It's simple just give luna the file and variables, That's it.
You can get rendered output by two methods, You can directly print on-screen, or luna will be return rendered content to you.
`render()` function takes one argument that is output type. By setting it true you will get renderer out put and you can use it however you want to, And if you set that false rendered content will be direclty print on screen. Anyways it's optional default is true.
```php
$luna->page( __DIR__ . '/mypage.html')
->with([
'title' => 'My very first page',
'message' => 'Hello world',
'name' => 'Gophy',
])
->render(false);
```