PHP code example of cnizzardini / cakephp-yummy

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

    

cnizzardini / cakephp-yummy example snippets


// Step 1. Basic Controller Usage:
$query = $this->ModelName->find();

$this->loadComponent('Yummy.YummySearch',[
    'query' => $query,
    'allow' => [
        'Table.column' => ['name' => 'Column Name'],
    ]
]);

$results = $this->paginate($this->YummySearch->search($query));

// Step 2. Basic View Usage:
$this->helpers()->load('Yummy.YummySearch');
echo $this->YummySearch->basicForm();

// Step 3. Include agnostic JavaScript
<script src="/yummy/js/yummy-search.js"></script>
 

// Basic Usage
$this->loadComponent('Yummy.YummyAcl',[
    'group' => $this->Auth->user('group'),
]);

// Define ACLs (you can also define ACLs in a single config file)
$this->YummyAcl->actions([
    'login' => '*', // allow all 
    'view' => ['Admin','Manager'], // allow Admin + Manager
    'edit' => ['Admin'], // allow Admin
]);