2017 © Pedro Peláez
 

library web-template-smarty

Smarty template integration for the base web application of the Ride framework

image

ride/web-template-smarty

Smarty template integration for the base web application of the Ride framework

  • Wednesday, December 7, 2016
  • by ride-user
  • Repository
  • 8 Watchers
  • 0 Stars
  • 3,386 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 30 Versions
  • 2 % Grown

The README.md

Ride: Template (Smarty)

This module adds template blocks, functions and modifiers for a Ride application to Smarty., (*1)

Block functions

[Smarty docs], (*2)

isGranted

Parse block content if the specified route/url/permission is allowed., (*3)

Parameter Type Description
route String Path to check for allowance.
url String URL to check for allowance.
permission String Permission code to check for allowance.
strategy String AND or OR when checking more then one of the above checks.
var String Variable to assign the result to. (true if this block content will be printed, false otherwise)
{isGranted permission="cms.node.varnish.manage"}
  ...
{/isGranted}

Note: The content of this block is always rendered. If the content is used for logic, assign the grant to a var and use an if statement., (*4)

isNotGranted

Parse block content if the specified route/url/permission is not allowed., (*5)

Parameter Type Description
route String Path to check for allowance.
url String URL to check for allowance.
permission String Permission code to check for allowance.
strategy String AND or OR when checking more then one of the above checks.
var String Variable to assign the result to. (true if this block content will be printed, false otherwise)
{isNotGranted permission="cms.node.varnish.manage"}
  ...
{/isNotGranted}

Note: The content of this block is always rendered. If the content is used for logic, assign the grant to a var and use an if statement., (*6)

Template functions

[Smarty docs], (*7)

apiMethodParameters

{apiMethodParameters method= url= namespace= classes=}

apiType

{apiType type= url= method= html= link= namespace= classes=}

image

Return the URL of a transformed image., (*8)

Parameter Type Description
src String Source url or file for this image.
default String Fallback for src parameter.
transformation String Name of the transformation.
var String Variable name to assign this URL to.
thumbnail --- Deprecated

:warning: Transformations may require additional parameters., (*9)

For more information about the transformations and their parameters, check out ride-lib-image., (*10)

{image src=$content->image var='image' transformation='crop'}

parsley

Adds parsley data attributes to the attributes of a form widget., (*11)

Parameter Type Description
type string Type of the form row widget
validators Array Validators of a form row
var String Variable name to assign the updated attributes to.
{$widget = $formRow->getWidget()}
{parsleyAttributes attributes=$widget->getAttributes() type=$widget->getType() var="attributes"}

tableVars

Add these FormTable variables to the template:, (*12)

  • $tableNameField
  • $tableActionField
  • $tableIdField
  • $tableOrderField
  • $tableSearchQueryField
  • $tablePageRowsField
{tableVars}

translate

Translate a key using the i18n translator., (*13)

Parameter Type Description
key String Translation key.
locale String Translation locale.
n Integer Number of items for a translation that describes multiple items.
var String Variable name to assign the translated key to.
{translate key='label.submit' locale='nl'}

:warning: When simply translating a key, using the {$key|translate} modifier syntax is preferred., (*14)

url

Create an URL., (*15)

Parameter Type Description
id String Route ID.
parameters Array Path arguments for the URL.
query Array Query parameters.
separator String Seperator for query parameters. (defaults to &)
var String Variable name to assign the URL to.
object Boolean Return URL Object instead of String. (defaults to false)
{url id='api.search' var='searchUrl'}

Modifiers

[Smarty docs], (*16)

decorate

Parameter Type Description
String ID of the decorator.

Common decorator IDs: storage.size / time / date.format / file / file.extension / file.size, (*17)

{$content->data->getDatePublished()|decorate:'time'}

safe

Modify a string value to safely use it as a file name, URL, id etc., (*18)

{'Unsafe string!'|safe} {* result: unsafe-string *}

translate

Parameter Type Description
Array Variables to be replaced in the translation.
{'label.fields.required'|translate}

Installation

You can use Composer to install this application., (*19)

composer require ride/web-template-smarty

The Versions

07/12 2016

dev-master

9999999-dev

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

07/12 2016

dev-develop

dev-develop

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

07/12 2016

1.1.0

1.1.0.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

15/10 2016

1.0.1

1.0.1.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

14/10 2016

1.0.0

1.0.0.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

08/10 2016

0.6.0

0.6.0.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

05/10 2016

0.5.4

0.5.4.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

29/09 2016

0.5.3

0.5.3.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

23/02 2016

0.5.2

0.5.2.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

12/01 2016

0.5.1

0.5.1.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

26/11 2015

0.5.0

0.5.0.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

12/11 2015

0.4.0

0.4.0.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

04/11 2015

0.3.15

0.3.15.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

15/10 2015

0.3.14

0.3.14.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

14/08 2015

0.3.13

0.3.13.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

14/08 2015

0.3.12

0.3.12.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

26/08 2014

0.3.11

0.3.11.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

19/08 2014

0.3.10

0.3.10.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

29/07 2014

0.3.9

0.3.9.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

26/06 2014

0.3.8

0.3.8.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

14/05 2014

0.3.7

0.3.7.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

04/05 2014

0.3.6

0.3.6.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

25/02 2014

0.3.5

0.3.5.0

Smarty template integration for the base web application of the Ride framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

19/02 2014

0.3.4

0.3.4.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

12/02 2014

0.3.3

0.3.3.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

12/02 2014

0.3.2

0.3.2.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

28/01 2014

0.3.1

0.3.1.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

22/01 2014

0.3.0

0.3.0.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

21/01 2014

0.2.0

0.2.0.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

29/11 2013

0.1.0

0.1.0.0

Smarty template integration for the base web application of the Pallo framework

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd