Download the PHP package morningtrain/wp-view without Composer

On this page you can find all versions of the php package morningtrain/wp-view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-view

Views

Laravel blade and view for WordPress with custom directives.

Table of Contents

Introduction

Getting Started

To get started install the package as described below in Installation.

To use the tool have a look at Usage

Installation

Install with composer

Dependencies

illuminate/view

illuminate/view

morningtrain/php-loader

PHP Loader is used to load and initialize all Hooks

Usage

For an overview see the official Laravel documentation

View directory

To set the main directory for views

Render a view

Working with namespaces

You may register a namespaced for a set of views. This is especially useful when writing plugins as you may group all your plugin views and not worry about duplicate naming. Views in a namespace may be overwritten in the main namespace as long as you use first() instead of render().

Eg. View::first(['vendor/myPlugin/myview','myPlugin::myview]) will render from the vendor dir first if the view exists, thereby allowing theme authors to overwrite this view when necessary.

Registering a namespace

Using a namespace

Custom @directives

This package contains some custom blade directives that you may use:

@wpauth()

@header()

Acts the same as : https://developer.wordpress.org/reference/functions/get_header/

The following will render the header.blade.php view or header-small.blade.php

@footer()

Acts the same as : https://developer.wordpress.org/reference/functions/get_footer/

The following will render the footer.blade.php view or footer-dark.blade.php

@script()

An easy way to enqueue an already registered script.

Using this directive is the same as calling wp_enqueue_script() with only the handle.

@style()

An easy way to enqueue an already registered stylesheet.

Using this directive is the same as calling wp_enqueue_style() with only the handle.

@username()

Prints the username of the currently logged in user or an empty string if no one is logged in.

@cache()

Caches content in a transient and uses the cached data if it exists

@react()

Prints a Morningtrain ReactRenderer compatible element with optional props. This makes it easy to prepare components for react to handle in the client.

The @react directive also supports a child view that will be rendered inside the component-wrapper until the react component is rendered. This is especially useful for skeletons and to avoid popping ins.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of wp-view with dependencies

PHP Build Version
Package Version
Requires illuminate/view Version ^8.83|^9.5
morningtrain/php-loader Version ^0.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package morningtrain/wp-view contains the following files

Loading the files please wait ....