Skip to content

Kirby 5.0.2

$page->code()

Filters the Files collection by type code

$page->code(): Kirby\Cms\Files

Return type

Kirby\Cms\Files

Parent class

Kirby\Cms\Page

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 ?>