Showing 7 of 1,975 result(s)
We can compile a document's echo statements, directives, and components using the compile method. Internally, the document will create a compiler instance by invoking the CompilerFactory::makeCompiler() factory method for us. By default, the...
min($key = null) The min method is the logical opposite of the max method, and accepts the same number of arguments. The min method can be used to retrieve the maximum value of the given $key . By default, the $key is null and will function in a...
toJson($options = 0) The toJson method will return a JSON encoded version of the data stored within the collection instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied....
…here might be some syntax to accomplish this with Antlers, I just couldn't figure it out at the time). You can use comparision operators in Antlers templates, but that becomes much more complicated when variables are being passed into partials,...
In the following example, we will change the currently configured fallback locale and observe how the fallback locale setting changes as we manipulate it. After the above code has executed, as we might expect, the local variables would contain the...
…ne.The signature of the abort_unless function is:The following example assumes that some $user object exists with the property admin . The example will check to make sure that the admin property is true . If not, the code will abort with a 401...
The sum is a simple method that returns the sum of all items in a collection. It also defines a $callback parameter which can be used to tell the sum method which values of the collection should be added together. If no items are in the...