Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 18/11/2017 Black Friday is coming

    Don't wait BLACK FRIDAY, use FRIDAY17 coupon code to get 35% discount for all our extensions right now.

  • 05/09/2017 BIG Autumn SALE

    Use AUTUMN17 coupon code to buy our WordPress or Joomla! extensions with 25% discount. Hurry up! The offer is valid till 11 September.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Documentation for the Format field
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Documentation for the Format field
#56700
Documentation for the Format field 1 Year, 11 Months ago Karma: 0
Is there any documentation about the parameters that can be used in Column settings>Format field? If found a couple of ad hoc examples here:
www.ari-soft.com/ARI-Data-Tables/55073-Format-view.html#55073 and here: www.ari-soft.com/ARI-Smart-Content/53632-PHP-code-in-format.html#53632 but I'm not sure if it's PHP, javascript, jquery or something else.

My immediate need is to format a number with a thousands separator. For example 30000 -> 30,000

Many thanks for the great extension and help.
Last Edit: 2016/01/09 09:48 By umbris.
The administrator has disabled public write access.
 
#56702
Re:Documentation for the Format field 1 Year, 11 Months ago Karma: 670
Hello,

"number_format" formatter is a wrapper for number_format and it accepts the same parameters. In your case use the following code:

{$value|number_format:2:,:.}

Regards,
ARI Soft
The administrator has disabled public write access.
 
#56703
Re:Documentation for the Format field 1 Year, 11 Months ago Karma: 0
Thank you for your quick reply. It turns out that what I actually needed was

Code:

{$value|number_format:0:.:,}



However, you didn't really answer my more important question about documentation. I realize that you probably don't want to sit down right now and bang out some good technical documents, but how about a short listing of what php format function are supported by wrappers. Also, a brief explanation of how to use regexreplace: and any other function wrappers that are supported.

If I'm not mistaken, it looks like this might be the starting point of a list of functions:

    class.UrlEncode.php
    class.UpperCase.php
    class.UniqueReplace.php
    class.Truncate.php
    class.StripTags.php
    class.RestoreTags.php
    class.Replace.php
    class.RegexReplace.php
    class.ParseIni.php
    class.NumberFormat.php
    class.LowerCase.php
    class.LoadAll.php
    class.JsonDecode.php
    class.HtmlTruncate.php
    class.Format.php
    class.FilterBase.php
    class.Filter.php
    class.Empty.php
    class.DBQuote.php
    class.DateFormat.php
    class.Base64Encode.php


All found here:

/modules/mod_aridatatables/includes/kernel/SimpleTemplate/Filters/

Thanks in advance!
The administrator has disabled public write access.
 
#56706
Re:Documentation for the Format field 1 Year, 11 Months ago Karma: 670
You are right. Filters which can be applied for values are located in modules/mod_aridatatables/includes/kernel/SimpleTemplate/Filters/ folder. Currently we don't have documentation for this.

RegexpReplace is a wrapper for preg_replace PHP function. It used in the following way:

{$value|regexreplace:find_pattern:replacement}

Where find_pattern is a regexp, replacement is the string to replace.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#56712
Re:Documentation for the Format field 1 Year, 11 Months ago Karma: 0
Thanks, that's very helpful. Here are a few more that I gleaned.

    {$value|lower_case} Converts value to lowercase

    {$value|upper_case} Converts value to uppercase

    {$value|replace:xxx:yyy} Replaces the string "xxx" with the string "yyy"
Last Edit: 2016/01/10 16:30 By umbris.
The administrator has disabled public write access.
 
Go to topPage: 1