Download the PHP package silber/client-templates without Composer

On this page you can find all versions of the php package silber/client-templates. 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 client-templates

Client Templates

This package provides a simple mechanism for you to load up all your client template views into your main application view.

What? Why?

Single page applications (SPAs) usually work by having the templates rendered on the client. For bigger applications, those templates might be loaded asynchronously as you need them. For smaller applications, it may make more sense to load all of your templates with the initial page load.

Since HTML templates are pretty new and not yet widely supported, most frameworks rely on the templates being served within script tags, marked up with some special type attribute to indicate that it is in fact a template.

Using this package, you can keep your templates nicely organized, with each template in its own separate file. With one simple call, you can then inject all of your templates into your main application view.

Documentation

This is a framework-agnostic package. It also comes with special Laravel integration classes, but those are optional.

Begin by installing this package through Composer. Open your terminal to your project's root directory, and enter this at the prompt:

composer require "silber/client-templates:dev-master"

Laravel Integration

Once the composer installation completes, you can add the service provider and the alias. Open app/config/app.php, and make the following changes:

1) Add a new item to the providers array:

2) Add a new item to the aliases array:

That's it! You're all set to go.

Usage

Now that you're all set up, you can start by actually creating your templates. Within the views directory, create a new templates directory. This is where you will keep all of your templates.

Here's a sample directory structure:

A sample template directory structure

Within each of those files, you will have only the HTML for that particular template.

Then, within your main index.blade.php file - right before the closing <body> tag - add this tiny piece of code:

This will automatically render all of your templates, as follows:

You can now use these templates in your favorite JS framework!

Configuration

If you wish to change any of the package's default options, you will first need to publish the configuration file to your app's config directory. You can do this by running the following artisan command:

This will create a new config file at config/templates.php. You can now edit this file to change the default options.

Template Type

By default, the type attribute is set to text/ng-template, which is what AngularJS uses. This can be changed in the package's configuration file. For example:

Strip Extension

By default, the template file's extension will be stripped from the HTML id attribute. If you wish to leave it in there, set it to false:

This will then output templates with their file's extension intact. For example:

Exclude Pattern

Sometimes you may wish to exclude some files or directories from being rendered as their own templates:

Views Directory

By default, the base directory for the templates is in the views directory. If you wish to change that, you can do so by setting it here:

Contributing

Thank you for considering contributing! This project follows Laravel's coding style.

License

The client-templates package is open-sourced software licensed under the MIT license.


All versions of client-templates with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/finder Version ~2.5
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 silber/client-templates contains the following files

Loading the files please wait ....