2017 © Pedro Peláez
 

library parrot

Repeats requested variables back as a placeholder for javascript templates in laravel

image

awkwardideas/parrot

Repeats requested variables back as a placeholder for javascript templates in laravel

  • Friday, March 17, 2017
  • by awkwardideas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Parrot: Repeats requested variables back as a placeholder for javascript templates in Laravel

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Install Via Composer

$ composer require awkwardideas/parrot

Add to config/app.php

Under Package Service Providers Add, (*2)

AwkwardIdeas\Parrot\ParrotServiceProvider::class,

Under Facades/Class Aliases Add, (*3)

'Parrot' => AwkwardIdeas\Parrot\Facades\Parrot::class,

Available Directives

@parrot('view.name', ['some' => "", 'data'=>"", 'parrotClass'=>"CustomClass", 'parrotID'=>"templateID"])
  • Similar to @include blade directive. Provide your own data to be used in the template, you only need to define the high level variables, actual values are not needed. Parrot will mock the values for these variables.
  • The parrotClass key can be provided to be output with @parrotClass. This will just echo the class, so it needs to be within a class="" attribute.
  • The parrotID key can be provided to be output with @parrotID. This will echo id='parrotIDValue', so that the ID can be optional on your markup.
@parrotif('view.name', ['some' => ""])

Similar to @includeif blade directive, (*4)

@parrotClass

If the template is called with parrot, it will show the $parrotClass variable. A default class of parrotTemplate is output if a custom class is not provided., (*5)

@parrotID

If the template is called with parrot, it will show the $parrotID variable., (*6)

@onParrot

Starts an if case for when parrot is being used. If not being parroted, the template wont render the contained content. An @else may be used with @onParrot, (*7)

@endOnParrot

Ends the if case for @onParrot, (*8)

@noParrot

Starts an if case for when the template is being render without parrot. If being parroted, the template wont render the contained content. An @else may be used with @noParrot, (*9)

@endNoParrot

Ends the if case for @endNoParrot, (*10)

The Versions

17/03 2017

dev-master

9999999-dev

Repeats requested variables back as a placeholder for javascript templates in laravel

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Chad Haney
by Awkward Ideas