PHP code example of codebjorn / loki

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

    

codebjorn / loki example snippets


Action::add('wp_enqueue_scripts', [\Namespace\Setup\Enqueues::class, 'front']);
Action::add('admin_enqueue_scripts', [\Namespace\Setup\Enqueues::class, 'admin']);



$post = \Mjolnir\Utils\Post::current();
$postTitle = $post->getTitle();
$postContent = $post->getContent();

\Loki\Facades\View::render('single', ['title' => $postTitle, 'content' => $postContent]);

\Namespace\Facades\Block::add('namespace', 'name');