PHP code example of froiden / knife

1. Go to this page and download the library: Download froiden/knife 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/ */

    

froiden / knife example snippets


    Froiden\Knife\KnifeServiceProvider::class
    

@use('Carbon\Carbon') // Observe that we have used only Carbon below instead of \Carbon\Carbon

@datetime('now') // 28th August 2015, 11:27 am
@date('now') // 28th August 2015
@time('2015-08-28 09:37:38') // 09:37 am

@set($count, 1)
{{ $count++ }} // 1
{{ $count++ }} // 2

@set($new)
{{ $new }}
{{ Carbon::now() }} // 2015-08-28 09:37:38

$bio = <<<HERE
Froiden Knife Plugin
nl2br demo
HERE;

@nl2br($bio)
/*
Froiden Knife Plugin<br/>
nl2br demo
*/

@escape("You're writing an unescaped string") \\ You\'re writing an unescaped string
<br/>