Site Variables
Anything you add to the array in config.php
will be made available in all of your templates, as a property of the $page
object.
For example, if your config.php
looks like this:
1<?php2 3return [4 'contact_email' => 'support@example.com',5];
...you can use that variable in any of your templates like so:
1@extends('_layouts.master')2 3@section('content')4 <p>Contact us at {{ $page->contact_email }}</p>5@stop
If you prefer, site variables can also be accessed as arrays:
1<p>Contact us at {{ $page['contact_email'] }}</p>
Jigsaw also supports environment-specific site variables, which you can learn more about here.