https://github.com/morphable/simpleview
https://github.com/morphable/simpleview
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/morphable/simpleview
- Owner: Morphable
- License: mit
- Created: 2019-02-06T19:35:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-17T19:08:22.000Z (over 6 years ago)
- Last Synced: 2025-01-01T02:35:02.725Z (over 1 year ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple view component
A simple view component, easy to implement into any system
## Usage
```php
serve("home.php", [
"title" => "hello world",
"helper" => new Helper()
]);
/*
* /views/home.php
*/
$data = $this->getData();
$helper = $data['helper'];
?>
= $this->include('components/header.php') ?>
if (isset($data['title'])): ?>
= $helper->translate($data['title'], 'NL') ?>
endif; ?>
= $this->include('components/footer.php') ?>
```
## Contributing
- Follow PSR-2 and the .editorconfig
- Start namespaces with \Morphable\SimpleView
- Make tests