Repeats requested variables back as a placeholder for javascript templates in laravel
45
0
2
Package Data
Maintainer Username: awkwardideas
Maintainer Contact: chad@awkwardideas.com (Chad Haney)
Package Create Date: 2017-03-17
Package Last Update: 2017-03-17
Language: PHP
License: MIT
Last Refreshed: 2024-04-26 03:04:29
Package Statistics
Total Downloads: 45
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

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