PHP code example of contributte / model

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

    

contributte / model example snippets


use Contributte\Model\ViewModel\Collections\LazyCollection;

$items = LazyCollection::fromCallback(callback $datasource);

foreach($items as $item) { // Datasource callback is called on first access

}

use Contributte\Model\Values\Email;

$email = new Email('[email protected]'); // Validate email format
$value = $email->get(); // Get value
$equal = $email->equal(new Email('[email protected]')); // Compare values of objects