Download the PHP
package ixa/layout without Composer
On this page you can find all versions of the php package
ixa/layout. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
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.
Ixa Layout is a WordPress library that provides basic support to use layouts in themes.
## Requirements
Besides PHP 5.3 you need a WordPress installation with [Composer], for example, [Ixa Wordpress Starter].
[composer]: http://getcomposer.org
[Ixa Wordpress Starter]: http://github.com/cesarhdz/ixa-wordpress-starter
## Installation
Require as dependency in `composer.json`
"require": {
...
"ixa/layout" : "0.3"
}
And register the filter in `/functions.php` file:
Ixa\Layout\LayoutFilter::register();
After registering the filter you can decorate your [views](#views) with [layouts](#layouts). By default layout folder is `/layouts`, it can be changed using the first parameter: `LayoutFilter::register($customDir)`.
## Views
In the layout pattern, a view is the template that holds the main content. In WordPress terms are the files loaded following template hierarchy.
Regular views have a structure similar to
`
Using IxaLayout we can get rid of all unrelated templates tag, writing only the main content:
`
IxaLayout will parse the content and display when the layout call `yield_content()` function.
### Layouts
Layouts are wrappers for views, they use the same syntax and functions that regular WordPress templates. They also have the covenient function `yield_content()` which loads the parsed content of the view.
A tipical layout would be:
`
### Layout Selection
All layouts must be placed under /layouts folder. default.php layout is requiered since is the fallback in case selected layout is not found.
Within a view we can set the layout we want to apply using `layout()` function. The first parameter is the relative path, without extension of the layout:
layout('services')
Ixa Layout Will try to load `/layouts/services.php` file, if it doesn't exists will fallback to `/layouts/default.php`. In case no layout is found an `Ixa/Layout/LayoutNotFoundException` wil be thrown.
## How _Ixa Layout_ works
Ixa Layout is a filter attached to `template_include` with a priority of `10000` in order to be run after all filters, then loads and saves the view selected by WordPress following template hierarchy and returns the path to the layout that WordPress loads.
Ixa Layout isn't a plugin that's why it requires to be autoloaded by Composer and registered in your `functions.php` file. This way we can have consistent code across environments because we don't have to wait the user to activate the plugin.
## Development status
It's not fully tested and may collapse with plugins or themes that use `template_include` filter or `ob_get_contents()` function.
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 ixa/layout contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.