Download the PHP package livy/cyrus without Composer

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

Cyrus

a simple object-based HTML generator

Usage

Cyrus uses objects and method chaining to construct semantic HTML elements and then output them for you.

The basic process is as follows:

Note: You can also instatiate Cyrus with its internal factory:

The above code will print out the following:

It supports any tag type, even ones you made up:

In general the order you chain methods in doesn't matter: $element->setClass('a-class')->setEl('p') is function equivalent to $element->setEl('p')->setClass('a-class'). There are, however, a few exceptions:

Initial Class

When instantiating Cyrus, you can specify a class for the primary element, by doing the following:

Nesting

You can nest elements inside of one another using the openChild and closeChild methods:

Object Nesting

If you pass a Cyrus object to addContent, that object will be inserted as content and automatically expanded.

Advanced Nesting

You can also nest items after a chain has been terminated by using the nest method an assigning an ID when calling openChild. This is especially useful if, say, you want to insert (or not) content based on a conditional without resorting to creating an entirely separate Cyrus instatiation:

You must point to nested elements directly, and define the entire path if they are nested more than one level down. You can do this by delimiting the ids with /, like so:

It's important to note that when opening up nesting contexts like this, all children must be closed. There are a two convenience methods that can help you with this, closeChildren and closeAll. closeChildren takes an integer as an argument, and will close a number children equal to that integer. closeAll takes no arguments, and will close all chilren that are open in the current context.

Methods

To learn how methods operate, have a look at the source files (./src). Each method is well documented.

The follow will cover some special functionality and edge cases.

Short forms

Any method that begins with "set" can be called in a shortened form, i.e. you can call setClass as just class.

Most nesting functions have short forms as well:

Advanced Attribute Manipulation

Unset Attribute

If you find you want to unset an attribute, call setAttr on it with the false argument:

Valueless Attributes

If you want to set an attribute that doesn't have a value--i.e. checked--you can do so by calling setAttr with the true argument:

setAttr, etc

setAttr and all of its aliased methods (i.e. setClass, setURL, etc) stack up whatever is passed to the same attribute--they don't overwrite anything. The only exception to this is if you pass false as an argument to setAttr, as this will completely remove that attribute from the element.

This value stacking means that the following statements are equivalent:

Negate Element with False Content

Using setContent to set the only content of an element explictly to bool false will cause that element to not be generated. This can be useful if you want elements to only appear if they have content. In order for the element to be negated, the following must be true:

Examples:


All versions of cyrus with dependencies

PHP Build Version
Package Version
Requires zenodorus/strings Version <2.0.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 livy/cyrus contains the following files

Loading the files please wait ....