awkwardideas/parrot

Repeats requested variables back as a placeholder for javascript templates in laravel
45
Install
composer require awkwardideas/parrot
PHP:>=5.6.4
License:MIT
Last Updated:Mar 17, 2017
Links: GitHub  ·  Packagist
Maintainer: awkwardideas

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

Latest Stable Version Total Downloads Latest Unstable Version License

Install Via Composer

$ composer require awkwardideas/parrot

Add to config/app.php

Under Package Service Providers Add

AwkwardIdeas\Parrot\ParrotServiceProvider::class,

Under Facades/Class Aliases Add

'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

@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.

@parrotID

If the template is called with parrot, it will show the $parrotID variable.

@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

@endOnParrot

Ends the if case for @onParrot

@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

@endNoParrot

Ends the if case for @endNoParrot

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660