PHP code example of tomkirsch / crud

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

    

tomkirsch / crud example snippets

 php
$rows = $userModel
    ->reset()
    ->joinModel('ProfileModel', 'profiles.user_id = users.id', 'left')
    ->selectUnique()
    ->findAll();
 php
$model->syncOneToMany(
    'foos2bars',
    ['foo_id' => 1],
    'bar_id',
    [12, 13],
    [5, 13, 14]
);
 php
$image = $row->prefixMap('image_', \App\Entities\Image::class, true);
 php
echo form_input('email', set_value_from('email', $user));
 php
helper(['date', 'form']);