$page->code()
Filters the Files collection by type code
$page->code(): Kirby\Cms\Files
Return type
Parent class
What is a code file?
Kirby considers the following file types as code:
- css
- js
- json
- java
- rb
- py
- scss
- xml
- yaml
- yml
Any html or php files cannot be uploaded to pages for security reasons.
Examples
<?php foreach($page->code()->filterBy('extension', 'css') as $css): ?>
<?= css($css->url()) ?>
<?php endforeach ?>