PHP code example of steampixel / simple-php-portals

1. Go to this page and download the library: Download steampixel/simple-php-portals 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/ */

    

steampixel / simple-php-portals example snippets




// Use this namespace
use Steampixel\Portal;

// Include portal class
// Lets throw some data into portals before the template is created
// Imagine this could be done through plugins or third party theme files
Portal::send('javascript', '<script>console.log("Hello world 1");</script>');
Portal::send('main-content', '<h1>Hey! Welcome</h1>');
Portal::send('style', '<style>body{background:#ccc;}</style>');

// Define for example a simple HTML template and fill it with target portals

// Autoload files using composer
pixel\Portal;

Portal::init();