Download the PHP package fewagency/macropiche without Composer

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

macropiche

PHP tool for display of view-templates in HTML.

If you're building a pattern/component library, this simple tool will display its parts to designers, developers, and clients for collaboration! It's basically one helper function that you can place anywhere within your PHP:

This will render an HTML <div> containing simple markup of:

Installation

composer require fewagency/macropiche

Background

Some reading on display patterns and atomic design - thinking that macropiche is designed to support:

Reading on more advanced use of pattern libraries:

Usage

The helper function can be used within any PHP file or PHP-based template using echo or <?=.

The $context is usually an array of variable names and values to populate the template.

Examples

The quick test php file to get you started and show the macropiche() helper method used in a PHP file.

Styling and scripting

The HTML generated by macropiche has CSS classes following the BEM approach for CSS naming so you may style elements anyway you want.

You should import your project's styles (and scripts) to your document to showcase your templates. But the assets of this package also include some simple stylesheets that you may import (or draw inspiration from) to style the actual macropiche elements:

Syntax highlighting

The <code> elements (wrapped in <pre>) have classes indicating the language of their contents that you can use for syntax highlighting, e.g. language-php for PHP code. This is useful with code syntax highlighters like Prism. Why not use the same configuration the Laravel docs use? Generated Prism files can also be found among the assets of this package for quick use.

Usage with Laravel Blade templates

If macropiche is used within a Laravel environment that has a view() helper available, it will be used as the rendering engine for the templates it seems to support.

In other situations you may declare your own helper called macropiche_blade_view() that should return an instance of Illuminate\Contracts\View\Factory (or similar - it's relaxed to work with Blade-packages that don't explicitly implement the interface). Examples of usage with duncan3dc/blade and jenssegers/blade can be found in examples/test-blade-duncan3dc.php and examples/test-blade-jenssegers.php respectively.

With Blade factories that implement the getFinder() method (like the one built into Laravel) it's possible to reference templates with the Blade dot-syntax relative the Blade views folder instead of supplying full or relative paths to macropiche.

Usage with Twig templates

macropiche currently supports HTML, PHP and Blade template files. We have support for Twig next in the feature pipeline!

<samp>!

The <samp> element is used to display the processed output, within <pre><code class="language-html">. It's not often one gets the opportunity to properly use <samp>, this type of package must be one of the few useful applications for that poor tag! For those of you that have not yet read the specification for the <samp> element, I highly recommend it!

...and if someone knows who wrote that hilarious official usage example, or where it came from, please get in touch and tell me!

Alternatives

There are of course other ways of building your HTML component library for display, some examples:

They all generate a full website, whereas this package aims to provide a simpler toolset for displaying templates within your existing project.

Authors

I, Björn Nilsved, created this package while working at FEW.


All versions of macropiche with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 fewagency/macropiche contains the following files

Loading the files please wait ....