Download the PHP package eisteeee/sectioned-view without Composer

On this page you can find all versions of the php package eisteeee/sectioned-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 sectioned-view

SectionedView

SectionedView implements layout inheritance and sections in php's native templates. It aims to be simple an easy to integrate

Features

Getting Started

Install

I recommend you install SectionedView via Composer:

composer.json:

"require": {
  "eisteee/sectioned-view": "~1.0"
}

or using the command line

composer require eisteee/sectioned-view

Requirements

Only PHP >= 5.3.0 is required

Quick Tutorial

Instantiate a SectionedView renderer:

$template_path = __DIR__ . "/templates"; //absolute path to your template directory
$view = new \SectionedView\View($template_path);
$view->render("hello.php", array('name' => 'World'));

templates/hello.php:

Hello, <?= $name ?>!

renders

Hello, World!

in order to return the rendered contents instead of printing them to output directly use:

$template_path = __DIR__ . "/templates"; //absolute path to your template directory
$view = new \SectionedView\View($template_path, array('echo' => 'false'));
$view->render("hello.php", array('name' => 'World'));

Using layouts & sections

considering the same setup as above, now we will use a layout file

templates\layout.php:

<html>
<head>
   <title>Hello</title>
</head>
<body>

</body>
</html>

templates\hello.php:

<!-- the moment you specify a layout file any text that is not within a section gets ommited -->
<!-- you can only specify one layout per file -->

   Hello, <?= $name ?>!

will render:

<html>
<head>
   <title>Hello</title>
</head>
<body>
   Hello, World!
</body>
</html>

Slim PHP Views

a view class for use in Slim PHP projects can be achieved as follows:

class SectionedSlimView extends \Slim\View
{
    private $sectionedView;
    public function __construct($template_base)
    {
        parent::__construct();
        $this->sectionedView = new \SectionedView\View($template_base);
    }

    public function render($template)
    {
        $this->sectionedView->render($template, $this->data->all());
    }
}

register it as your Slim view:

$template_path = __DIR__ . "/templates"; /* path relative to specified template_path in SectionedView */
$app = new \Slim\Slim(array(
    "view" => new SectionedSlimView($template_path);
));

and you are good to go


All versions of sectioned-view with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 eisteeee/sectioned-view contains the following files

Loading the files please wait ....