PHP code example of simones / partial

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

    

simones / partial example snippets


// one-argument binding
$hello = partial('printf', ['Hello, %s']);
$hello('world') // print "Hello, world"
// or
$hello->call('world')


// multiple arguments binding
$countdown = partial('printf', ['%s, %s, %s, go!', 'Three']);
$countdown('Two', 'One'); // print "Three, Two, One, go!"


// you can skip argument, and they will be filled on call time
$countdown = partial('printf', ['%s, %s, %s, go!', Partial::SKIP, 'Two']);
$countdown('Trhee', 'One'); // print "Three, Two, One, go!"