The percentage of total load time dedicated to run this expression. The amount of time it took to run the expression along with any child expressions (e.g. The amount of time it took to run the expression The number of separate times the expression was executed. How much memory was used to execute this expression. If you have configured the debugbar by publishing its config and have specified which code editor you use, you can click the line and open your editor straight to this bit of template code. When using the Expression Graph, shows the path to the view file the expression exists in. Shows whether the expression is an imported view, a variable, or a Tag. This helps to see the order your code is executed in. Starting from 00:00, exactly when on the timer this expression was run. Green is fast, Yellow is a little slow, and Red is very slow. The Source View shows the final rendered template and highlights any content rendered by Antlers with a color corresponding to how fast it was executed. This view shows all parsed expressions in a given request, listing them in execution order.Įach parsed expression in this view gets its own row in the table that shows various metrics and details that may prove to be useful. This view groups your Antlers expressions by the view files (templates, layouts, and partials) they exist in, allowing you to more easily tease out the location of any potential slowdowns or redundant calls.Įach parsed expression in this view gets its own row in the table that shows various metrics and details that may prove to be useful. Inside this Profiler there are 3 separate views that give you different glimpses into your site. If the value of the right-hand expression returns a value that can be iterated (arrays, objects, etc.), the captured variable name can be used as a tag pair to iterate the returned value immediately.Īntlers has an experimental new Profiler tab in the Debugbar that helps you see the performance impact of all of your template code. The left assignment operator has a super power not shared by the others. NameĪssigns the difference of $a and $b to $a.Īssigns the remainder of $a divided by $b to $a. This is how you create variables as well as increment, decrement, or otherwise manipulate numerical variables. This means left operand gets set to the value of the expression on the right. You might immediately think that means "equal to", but stop right there. And since the cool kids are doing it, Antlers does math now too! Name Teenagers have been found in back rooms and back alleys doing math and nobody can seem to stop them. Future you will thank you, but don't expect a postcard. We recommend using a single space between braces and the inner expression, lowercase variable names, and underscores as word separators. You may break up an expression onto multiple lines.Ĭonsistency is important.Whitespace between the curly braces expression is optional, but recommended for readability.Use underscores and not dashes to separate words in variable names.There must be a left pair and a right pair, just like HTML's angle braces. Each set of curly braces must stay together always, like Kenan & Kel or Wayne & Garth.Allow you to write, execute, and echo PHP. If you want to go beyond these docs and really dive into Antler's advanced capabilities, check out Antlers: Building Beautiful Websites with Statamic, the official companion book by the great John Koster. antlers.html file extension is an "Antlers Template", and will be parsed with the Antlers Engine. Any files in the resources/views directory with an. It consists of a tightly coupled template language, runtime engine, and library of Tags that can be used to fetch and manipulate data, handle logic, and help you write easier to maintain HTML.Īntlers templates are also called views. Antlers is one Statamic's foundational features.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |