awallef/cake3-3xw-back

CakePHP 3 skeleton backend app

Installs: 48

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 3

Forks: 1

Language:JavaScript

Type:project

0.1.0 2016-04-05 07:49 UTC

README

Build Status License

A skeleton for creating applications with CakePHP 3.x.

The framework source code can be found here: cakephp/cakephp.

Installation

  1. Download Composer or update composer self-update.
  2. Run
php composer.phar create-project --prefer-dist awallef/cake3-3xw-back [app_name]

or if Composer is installed globally, run

composer create-project --prefer-dist awallef/cake3-3xw-back [app_name]
  1. Modify the config/app.php with your database information
  2. Go to your app dir and run
bin/cake setup

You should now be able to visit the path to where you installed the app and see the setup traffic lights.

sources' and any other configuration relevant for your application.

Attachments

In controllers

Avoid querying Attachments in your add and edit methods

in add.ctp

echo $this->element('Attachments/add', array(
    'settings' => array(
        'relations' => 'belongsToMany', // or belongsTo
        //'field' => 'attachment_id'  // if belongsTo
        'maxsize' => 30, // 30MB
        'types' => array(
            'image/jpeg',
            'image/png',
            'application/pdf'
        )
    ),
    'attachments' => []
));

in edit.ctp

echo $this->element('Attachments/add', array(
    'settings' => array(
        'relations' => 'belongsToMany', // or belongsTo
        //'field' => 'attachment_id'  // if belongsTo
        'maxsize' => 30, // 30MB
        'types' => array(
            'image/jpeg',
            'image/png',
            'application/pdf'
        )
    ),
    'attachments' => $corresondence['attachments']
));