Showing 10 of 2,044 results.

The Finish Line | Building a Simple Statamic Request Addon

Congratulations you've just implemented a really simple Statamic addon tag that can be used to learn about request input. It would be trivial to expand this addon tag to learn more about the incoming request; this might be something for another...

Laravel MessageBag Public API: count

The count method is a straightforward method and simply returns the total number of items in the collection. The count method returns an integer. 1 <?php 2 3 use Illuminate \ Support \ Collection ; 4 5 // Create a new collection instance. 6 $...

Laravel ViewErrorBag Public API: count

The count method returns the number of messages stored within the default MessageBag instance. It is also the only MessageBag method that specifically handled by the ViewErrorBag instance itself because it needs to be declared within the...

X/Twitter Metadata

…The values it uses are pulled from the config/site_essentials/metadata.php configuration file: 1 <?php 2 3 return [ 4 ' twitter ' => [ 5 ' site ' => null , 6 ' site_id ' => null , 7 ' creator ' => null , 8 ' creator_id ' => null , 9 10 '...

getPhpTags | Querying Document Nodes

Returns all PHP tags within the document. PHP tags are created after parsing raw PHP regions within the source template. PHP tags will be created whenever the following types of PHP tags are encountered: PHP Short Echo:, <?= ?>, PHP Open:, <?php...

Front-end Templates

The required meta tags can be added to your front-end Antlers templates in a few different ways. The simplest method is to use the provided {{ get_social_media_images /}} tag: 1 <! doctype html > 2 < html > 3 < head > 4 {{ get_social_media_images...

Laravel 5 Macros: Creating Callback Macros

The first method of creating macros we will explore is the callback function macro. These macros are added to the various classes directly by calling the macro method on the macroable class and then supplying the callback function that will be...