Download the PHP package jameslevi/stencil without Composer

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

Stencil


Is a simple PHP Class templating library.

Getting Started

  1. You can install via composer.

  2. If not using any framework, paste the following code at the upper part of your project to load the composer autoload mechanism.

  3. Basic implementations.

The code above will generate PHP file with content like this.

Import Class Implementation

You can use "use" method to import classes in to your template.

You can also set alias for your imported class to avoid naming conflict.

This command will generate code like this.

Extend Classes

You can extend class using "extends" method. Just make sure you imported your parent class.

Implement Interfaces

You can implement one or more interface classes using "implement" method.

The example above will generate code like this.

Abstract Class

You can set your class as an abstract class.

The example above will generate code like this.

Raw Content

You can add content in each line using "raw" method. You can use "setIndention" method to set tab spaces in the beginning of each line.

The example above will generate code like this.

Line Breaks

You can add single line break using "lineBreak" method.

You can also make multiple line breaks by providing the first argument.

Constants

You can declare constant values in your class using "addConstant" method.

The example above will generate code like this.

Variables

You can declare class variables with public, private and protected visibility.

The above example will generate code like this.

Non-Static Variables

Variables that are only accessible when class is instantiated.

The above example will generate code like this.

Static Variables

Variables that are accessible even without instantiating a class.

The above example will generate code like this.

Single Line Comment

You can add single line comment using "addLineComment" method.

The above example will generate code like this.

Block Comment for Variables

You also add multi-line comments using "addComment" method.

The above example will generate code like this.

Method Functions

You can add methods for your class using "addMethod" method.

The above example will generate code like this.

Static Methods

You can also set if method is static using "setAsStatic" method.

The above example will generate code like this.

Method Arguments

You can add multiple arguments in your method using "addParam" method.

The above example will generate code like this.

Method Content

You can add content in to your method using "raw" method.

The above example will generate code like this.

Abstract Method

You can also add abstract method in to your abstract class using "setAsAbstract" method.

The above example will generate code like this.

Block Comments for Methods

You can add block comments using "addComment" method.

The above example will generate code like this.

Constructor Method

You can also add constructor to your class using "makeConstructor" static method.

The above example will generate code like this.

Contribution

For issues, concerns and suggestions, you can email James Crisostomo via [email protected].

License

This package is an open-sourced software licensed under MIT License.


All versions of stencil with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
jameslevi/string Version ^1.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 jameslevi/stencil contains the following files

Loading the files please wait ....