Download the PHP package habanero/neddle without Composer

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

Tailor's skills!

Neddle is inspired from HAML/Jade and CoffeeScript, isn’t really a full parser but it handles your templates very well.

Ok, it might have issues and do not throw any warnings about syntax errors.

The basics

Like other haml-like templating engines, it uses white space to nest your blocks. Also has minimal support for inline expressions, closures and almost all php code.

inline-comments

/ html
- # php
; invisible

block-comments

/
  large and
  nested html comments

html-blocks

#id.class { attr => $value }
  a { href => '#' } link text

p
  nested text
  here

pre
  |and the pipe
  |    preserves the white-space
  | in the block

<table>
  <tbody>
    <tr>
      <td>also you can use raw html</td>
    </tr>
  </tbody>
</table>

\a string value (not parsed)
a string value (parsed)

:some-filter
  any block of text (not parsed)

php-blocks

- if $condition
  = 'success'

ul
  - for $i = 0; $i < 10; $i += 1
    li = "Item $i"

- $all = array(1, 2, 3)
p #{$one} @while $one = array_shift($all)

- unless false
  some text

- print_r(call_user_func(~>
  - return range(0, 10)

- $lambda = ($value) ~>
  - return $value

= $lambda('some value')
~ $lambda('<p>escaped text</p>')

As you can see the syntax is very simple and compatible with php. ;-)

Usage

Append it to your composer.json, then run $ php composer.phar install to get the latest version.

{
  "require": {
    "habanero/tailor": "dev-master"
  }
}

Remember that neddle will not handle your views, it only pre-compile your templates into php code. You should save and execute the produced code.

<?php

require 'vendor/autoload.php';

# raw handling
$tpl = 'a { href => "#" } = "link"';
$out = Neddle\Parser::render($tpl);

eval('; ?' . ">$out"); // <a href="#">link</a>

# using as helper
function view($file, array $vars = array()) {
  ob_start();

  $tpl = file_get_contents($file);
  $_tpl = tempnam('/tmp', md5($file));
  file_put_contents($_tpl, Neddle\Parser::render($tpl));

  extract($vars);
  require $_tpl;
  unlink($_tpl);

  $out = ob_get_clean();

  return $out;
}

# full-view rendering
$tpl = 'example.neddle';
$out = view($tpl, array('name' => 'Joe'));

echo $out; // <p>Hello Joe!</p>

And this is the source for the example.neddle file.

p = "Hello $name!"

Want to collaborate?

If you like, fork, download and use it.


All versions of neddle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 habanero/neddle contains the following files

Loading the files please wait ....