PHP code example of php-enspired / peekaboo

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

    

php-enspired / peekaboo example snippets


use at\peekaboo\ {
  HasMessages,
  MakesMessages
};

class Foo implements HasMessages {
  use MakesMessages;

  public const MESSAGES = [
    "welcome" => "welcome to the {place}, we've got fun and games"
  ];
}

echo (new Foo())->makeMessage("welcome", ["place" => "jungle"]);
// welcome to the jungle, we've got fun and games