Download the PHP package jrbarnard/proto without Composer

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

Front end templating framework

This project is made to help rapid development of front end website prototypes with a component based system and a non folder based route structure.


Contents

  1. Project setup
  2. Usage
    • Structure general
    • Creating a template
    • Linking a page to a template
    • Going further with page content
    • Going further with templating
  3. Menus
  4. Development helpers
    • Clearing cache
    • Development twig functions

Project setup

Composer project install:

  1. composer create-project jrbarnard/proto your-project-name --prefer-dist
  2. This will run composer install for you. Or:
  3. Clone / download the framework into your project directory.
  4. Run composer install in the project root, if you don't have composer download here

After either:

  1. Run a webserver and point it to the project directory
    • You can either do this by using Wamp, Mamp, Xampp, Vagrant etc.
    • Or by running the utility helper (only available in php 5.4+):
    • In the root

You will then have the example project set up! Take some time to look at the examples, how it's used and any comments.

--

Usage

You are free to use, extend, edit etc however you wish, however the generic usage to get you started is below.

Structure general:

The underlying structure of this tool is the routes you set up in your structure.json file, this is located in the root of the project.

The rough structure is:

Creating a template:

Create a file within the templates directory with a .twig extension, e.g location-detail.twig Most templates will extend a base or set of base templates, at the top of your page, ensure to extend the relevant one.

You can then hook into the extended templates blocks For example, in the example files base.twig it has a block called 'content', to hook into this do:

Linking a page to a template

Now you have a template you can link a page up to it.

That's pretty cool, but it gets old real fast when you have multiple pages that would use the same template, but uses different text So you can add multiple pages that share templates:

Going further with page content

You can pass content as json directly to the content attribute of a page in structure.json, however if you have lots of per page content with heavily nested data, it can get very very messy. A better way sometimes would be to seperate out your content to a file and then reference that.

Going further with templating

Because this uses Twig for templating, it means you can use all available 'twigness' in your prototype to assist with your development, for full documentation visit: http://twig.sensiolabs.org/


Menus

Built into this are a few helpers to help generate common menus within your twig templates.

Within the example application are implementations of all of them.

For instance, for the top menu, we use the template part: templates/parts/topnav.twig:

It also comes with the following navigation examples:

If you need further custom ones, you will be able to extend the built in navigation options soon.


Development helpers

To assist with development there are a few utilities and helpers you can use throughout prototyping.

Clearing caches

In order to speed up the load times of the prototype, we cache the twig templates so we don't have to render on every request. This however can cause problems when changing things, by default if you set your environment to dev, it will automatically prevent the twig cache, however if you change this, or you have old twig caches, it may become necessary to clear it.

To do so, go to the command line in the root of the project and run:

Twig dumper

The built in twig dumper is useful, however it isn't exactly easy to use / see the things you're dumping to the screen.

As a development dependency this project uses the symfony dumper and there are a couple of twig functions available to you.

In a twig template do the following:

Accessing variables set in your .env file

Your .env file is for setting environment variables in one central, non committed location.

This allows you to have different settings for general environment settings, third party services etc. depending on the environment where your code is.

For instance if you have an integration with twitter, you may want to have different settings or credentials depending on whether your prototype is currently local or on uat, so you can set these on the environments own .env file and therefore when your prototype boots there it will automatically get those details.

In order to gain access to your .env variables within twig follow the below:


All versions of proto with dependencies

PHP Build Version
Package Version
Requires twig/twig Version ^1.24
twbs/bootstrap Version ^3.3
vlucas/phpdotenv Version ^2.2
symfony/console Version ^3.1
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 jrbarnard/proto contains the following files

Loading the files please wait ....