Download the PHP package davidyell/listing without Composer

On this page you can find all versions of the php package davidyell/listing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package listing

CakePHP-Listing

Model behaviour to append an optgroup into a list for a select box. The idea for this behaviour is that if you have a list of items which belong to another model, it will include that models name. So if you are looking for a specific item by it's relation, this will make that easier. I have created a website for the plugin, with more detailed information. http://jedistirfry.co.uk/CakePHP-Listing/

So we change,

..into this..

..and you should end up with nice option groups in your selects.
Select box with optgroup

It works with multiselect too!
Multi select box with optgroup

Version

This is something I'd consider beta.
I've created tests for this code and it achieves 96.88%.
Build Status

Installation

This is a standard CakePHP plugin, so it will need to extracted or submoduled into your app/Plugin folder. I call it Listing, so it should live in app/Plugin/Listing.

You will need to activate the plugin in your app/Config/bootstrap.php using CakePlugin::load('Listing'), unless you are already using CakePlugin::loadAll()

Requirements

The models you are using with this behaviour must have Containable enabled. public $actsAs = array('Containable', 'Listing.Listable'); I tend to add Containable to my AppModel as it's handy to have everywhere!

Usage

You can attach to the model using the $actsAs array. As you would normally. You must include the name of the related model that you want to join to when you configure the behaviour.

This is usually the parent model in the relationship, as the behaviour will attach to the child. So if you want to list Broadband by Provider you would attach the behaviour to the Broadband model, and configure the relatedModelName as Provider.

Configuration

You can also specify the fields that you want to use using, primaryKey and displayField.

More on Behaviours in the Book.

Getting a listing

Then in order to attach the extra model, I have implemented a custom find called listing which will return the formatted list.

For example, $broadbands = $this->Broadband->find('listing');

Customising your listing

The easiest way to customise the display of your listing is to use the models $virtualFields property to create new fields which you can then pass into the find. Let's look at an example.

We want a listing of all the Users grouped by role. However our database has both first_name and last_name, but we want to display a listing of the users full name. We can create a virtual field and select that.

Todo

Alpha

Beta

License

The MIT License (MIT)

Copyright (c) 2013 David Yell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of listing with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidyell/listing contains the following files

Loading the files please wait ....