Initial commit
This commit is contained in:
19
site/controllers/album.php
Normal file
19
site/controllers/album.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Controllers allow you to separate the logic of your templates from your markup.
|
||||
* This is especially useful for complex logic, but also in general to keep your templates clean.
|
||||
*
|
||||
* In this example, we define the `$gallery` variable which is passed to the template
|
||||
*
|
||||
* More about controllers:
|
||||
* https://getkirby.com/docs/guide/templates/controllers
|
||||
*/
|
||||
return function ($page) {
|
||||
|
||||
$gallery = $page->images()->sortBy('sort', 'filename');
|
||||
|
||||
return [
|
||||
'gallery' => $gallery
|
||||
];
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user