You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -77,6 +85,30 @@ Variables can also be checked with:
77
85
<?php base_layout_has('class'); ?>
78
86
```
79
87
88
+
### Mock Data
89
+
90
+
The Faker library allows you to generate random content for a wide variety of patterns. For a full list see [the documention](https://github.com/fzaninotto/Faker#formatters).
91
+
92
+
```php
93
+
$faker = base_faker_factory();
94
+
95
+
echo $faker->email;
96
+
```
97
+
98
+
If you only need a single use you can shorthand the above to:
99
+
100
+
```php
101
+
echo base_faker_factory()->email;
102
+
```
103
+
104
+
### URLs
105
+
106
+
The fully qualified domain name can be returned using `base_http_host()`. The function will automatically add the correct protocol if SSL is enabled:
Migrating a static site to Perch is simply a matter of replacing `base_` with `perch_` on each of the above functions. This is deliberate to reduce the time spent converting files to use Perch's template system.
0 commit comments