Download the PHP package simphotonics/node without Composer

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

Simphotonics Node

PHP Composer

Simphotonics nodes can be used to to create, edit, search, and output HTML nodes. The library contains classes that help with the creation of tables.

Node make composing HTML documents easier by removing the need for structured text and enabling reuse of HTML nodes. Most web sites use a fixed page layout that is then filled with the page content: text, anchors, images, etc. The section web page template shows how to use nodes to create a simple two column empty web page prototype.

Simphotonics Node also includes a rudimentary HTML parser, a DTD parser, and a Node Renderer. For more information visit https://github.com/simphotonics/node/tree/master/src/Parser.

Installation

From a terminal issue the command:

Alternatively, add simphotonics/node to the list of required libraries in your composer.json file:

Usage

To create nodes, an array with optional entries *kind, attr, content, and childNodes is passed to the constructor:

Note that the element kind refers to the HTML element tag name. The HTML paragraph in the example above is of kind p, whereas the HTML image is of kind img. To render the nodes in the example above, we use:

The statement above returns the following string (whitespace has been added to highlight the structure of the html source code):

Web Page Template

The following example shows how to quickly generate a simple web page layout using nodes. It can be used as a prototype empty HTML document that is later filled with actual web page content.

Let's assume that the PHP source code above was saved to the file layouts/emptyDocument.php. We now use the empty document layout to create the page AboutUs.php. If you are using a framework this could be the view loaded when routing to /about-us.

Web Page Navigator - HtmlNavigator

The class HtmlNavigator can be used to create a PHP/CSS driven web page navigator. The class searches all descendant nodes for anchors pointing to the current uri. The parent node of the anchor is then added to the CSS class 'here' (to enable styling).

A web page navigator typically consists of an unordered list where the list items are the navigator buttons and contain the navigator anchors (links). The following example illustrates how to create a simple navigator with just two entries - Home and Services.

Let's assume that the current relative uri is /services, then rendering $nav from within PHP yields the string:

For completeness I include a rudimentary CSS file showing the basic styling of the navigator components. Notice the styling of the class li.here that will highlight the navigator button pointing to the current page.

Html Tables Made Easy - HtmlTable

The class HtmlTable can be used to create and manipulate HTML tables. The usage is demonstrated below:

The code above will render the following html table:

Data1 Data2 Data3
Data4 Data5 Data6
Data7 Data8 Data9

Alternative rows can be styled using the CSS class alt. Table input other than nodes are wrapped in an node of kind span. The HTML source code is shown below:

The class HtmlTable contains methods that allow changing the table layout:


All versions of node with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.0
simphotonics/utils 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 simphotonics/node contains the following files

Loading the files please wait ....