PHPackages                             wpdesk/wp-view - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. wpdesk/wp-view

ActiveLibrary[Templating &amp; Views](/categories/templating)

wpdesk/wp-view
==============

2.1.3(7mo ago)067.1k↓37.9%17MITPHPPHP &gt;=7.4 | ^8CI failing

Since May 18Pushed 1mo agoCompare

[ Source](https://github.com/WP-Desk/wp-view)[ Packagist](https://packagist.org/packages/wpdesk/wp-view)[ RSS](/packages/wpdesk-wp-view/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (15)Used By (17)

[![Tests](https://github.com/WP-Desk/wp-view/actions/workflows/tests.yml/badge.svg)](https://github.com/WP-Desk/wp-view/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/c61c152523093e27f36e8f48b673058e3d582a959a1d5c3920d35347ce72f2d9/68747470733a2f2f706f7365722e707567782e6f72672f77706465736b2f77702d766965772f762f737461626c65)](https://packagist.org/packages/wpdesk/wp-view)[![Total Downloads](https://camo.githubusercontent.com/eda87022914900c471aede4e604e9b95824a242a9887972d5d8bf44fb8e914ad/68747470733a2f2f706f7365722e707567782e6f72672f77706465736b2f77702d766965772f646f776e6c6f616473)](https://packagist.org/packages/wpdesk/wp-view)[![License](https://camo.githubusercontent.com/7bfa54a4a5c48cc67677311f1d12faa74b4f60ff4185f5d5ecbae33ad35327ec/68747470733a2f2f706f7365722e707567782e6f72672f77706465736b2f77702d766965772f6c6963656e7365)](https://packagist.org/packages/wpdesk/wp-view)

WP View
=======

[](#wp-view)

WP View is a lightweight PHP library for rendering PHP templates. It can be used as a standalone renderer and also provides resolvers for WordPress theme overrides and WooCommerce-style template loading.

Requirements
------------

[](#requirements)

- PHP 7.4 or later, including PHP 8.x.
- Composer.
- WordPress is required when using `WPThemeResolver` or `PluginViewBuilder`.
- WooCommerce is required when using `WooTemplateResolver`.

Installation via Composer
-------------------------

[](#installation-via-composer)

Install the package with [Composer](https://getcomposer.org/):

```
composer require wpdesk/wp-view
```

Composer autoloads the library with the `WPDesk\View\` namespace.

Basic usage
-----------

[](#basic-usage)

`SimplePhpRenderer` renders a PHP template resolved by a resolver. The renderer adds the `.php` extension, so `template-name` resolves to `template-name.php`.

```
