diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ffa89b56e1d2c45e2843d47aa541b65f2cffcd55 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 WP Desk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..46c3404772d5a6ac95d45ff9ca0e8c213fd4b19e --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +[](https://gitlab.com/wpdesk/wp-view/pipelines) +[](https://gitlab.com/wpdesk/wp-view/commits/master) +[](https://packagist.org/packages/wpdesk/wp-view) +[](https://packagist.org/packages/wpdesk/wp-view) +[](https://packagist.org/packages/wpdesk/wp-view) + +WP View +======= + +wp-view is a simple to render templates. + +## Requirements + +PHP 7.0 or later. + +## Installation via Composer + +In order to install the bindings via [Composer](http://getcomposer.org/) run the following command: + +```bash +composer require wpdesk/wp-view +``` + +## Example usage + +```php +<?php + +$resolver = new \WPDesk\View\Resolver\ChainResolver(); +$resolver->appendResolver( new \WPDesk\View\Resolver\WPThemeResolver( 'example-plugin' ) ); +$resolver->appendResolver( new \WPDesk\View\Resolver\DirResolver( trailingslashit( __DIR__ ) . 'templates' ) ); +$renderer = new \WPDesk\View\Renderer\SimplePhpRenderer( $resolver ); + +$renderer->render( 'template-name', ['param1' => 'test'] ); +``` diff --git a/composer.json b/composer.json index d446d53d0e1f82c9ec35f02286cd5f1c5ee459c3..9aabcbfd6524c8565176bfdfeb7d3681b73b80be 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "wpdesk/wp-view", + "license": "MIT", "authors": [ { "name": "Krzysiek",