PHP code example of beebmx / kirby-blade

1. Go to this page and download the library: Download beebmx/kirby-blade library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

beebmx / kirby-blade example snippets


const KIRBY_HELPER_E = false;
// or
define('KIRBY_HELPER_DUMP', false);



define('KIRBY_HELPER_DUMP', false);


'beebmx.kirby-blade.views' => '/site/storage/views',

@js('js/app.js')
@css('css/app.css')
@kirbytext($page->text())
@kt($page->text())
@kirbytextinline($page->text())
@kti($page->text())
@smartypants($page->text())
@esc($string)
@image($page->image())
@svg($file)
@page($id)
@pages($id)
@markdown($page->text())
@html($page->text())
@h($page->text())
@url($page->url())
@u($page->url())
@go($url)
@asset($page->image())
@translate($translation)
@t($translation)
@tc($translation, $count)
@dump($variable)
@csrf()
@snippet($name, $data)
@twitter($username, $text, $title, $class)
@video($url)
@vimeo($url)
@youtube($url)
@gist($url)

'beebmx.kirby-blade.directives' => [
    'greeting' => function ($text) {
        return " echo 'Hello: ' . $text 

'beebmx.kirby-blade.ifs' => [
    'logged' => function () {
        return !!kirby()->user();
    },
],

@logged
    Welcome back {{ $kirby->user()->name() }}
@else
    Please Log In
@endlogged


<!-- ../templates/components/alert.blade.php -->

<x-alert/>


<!-- ../templates/components/button.blade.php -->

<x-button></x-button>



<!-- ../templates/components/inputs/button.blade.php -->

<x-inputs.button/>



<x-alert title="Danger">Message</x-alert>

<!-- ../templates/components/alert.blade.php -->

<div class="alert">
    <div>{{$title}}</div>
    <div>{{ $slot }}</div
</div>