PHP code example of mirko-pagliai / cakephp-essentials

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

    

mirko-pagliai / cakephp-essentials example snippets


use Cake\Essentials\View\View;

class AppView extends View
{
}

class AppView extends View
    public function initialize(): void
    {
        parent::initialize();
    
        /**
         * These override any helpers defined by the parent.
         */
        $this->addHelper('Html');
        $this->addHelper('Form');
    }
}

echo $this->fetch('css');
echo $this->Html->css('/vendor/bootstrap/css/bootstrap.min.css');
echo $this->Html->css('/vendor/bootstrap-icons/bootstrap-icons.min.css');

echo $this->fetch('script');
echo $this->Html->script('/vendor/jquery/jquery.min.js');
echo $this->Html->script('/vendor/bootstrap/js/bootstrap.min.js');
echo $this->Html->script('/cake/essentials/js/collapsible-toggle-icon.min.js');

echo $this->Html->script('/cake/essentials/js/enable-popovers.min.js');
echo $this->Html->script('/cake/essentials/js/enable-tooltips.min.js');

Configure::write('Bake.theme', 'Cake/Essentials');

/**
 * Sets the default locale date and time format.
 *
 * @see https://book.cakephp.org/5/en/core-libraries/time.html#setting-the-default-locale-and-format-string
 * @see https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax
 */
Date::setToStringFormat('dd/MM/yyyy');
DateTime::setToStringFormat('dd/MM/yyyy HH:mm');