PHPackages                             lorenzo/linkable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. lorenzo/linkable

ActiveCakephp-plugin[Framework](/categories/framework)

lorenzo/linkable
================

CakePHP Linkable Behavior

1.1.1(11y ago)2753.3k↓40.2%9[3 issues](https://github.com/lorenzo/linkable/issues)[2 PRs](https://github.com/lorenzo/linkable/pulls)MITPHP

Since Jun 4Pushed 10y ago4 watchersCompare

[ Source](https://github.com/lorenzo/linkable)[ Packagist](https://packagist.org/packages/lorenzo/linkable)[ Docs](https://github.com/lorenzo/linkable)[ RSS](/packages/lorenzo-linkable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

CakePHP Linkable Behavior
=========================

[](#cakephp-linkable-behavior)

Linkable behavior is a companion for the CakePHP built-in containable behavior. It helps fill the gaps that are not covered by containable: You will be able to contain association that are not directly associated with your model and to generate queries joining all specified models.

This is particularly useful when you want to filter results by conditions in a hasMany or hasAndBelongsToMany relationship.

Original behavior by rafaelbandeira3 on GitHub.

Licensed under The MIT License Redistributions of files must retain the above copyright notice.

Requirements
------------

[](#requirements)

- CakePHP 2.x
- PHP 5.2+

Installation
------------

[](#installation)

If you are using composer, add this to your composer.json file:

```
	{
		"extra": {
			"installer-paths": {
				"Plugin/Linkable": ["lorenzo/linkable"]
		}
	},
		"require" : {
			"lorenzo/linkable": "master"
		}
	}
```

Otherwise just clone this repository inside your app/Plugin folder:

git clone git://github.com/lorenzo/linkable.git Plugin/Linkable

### Enable plugin

[](#enable-plugin)

You need to enable the plugin your `app/Config/bootstrap.php` file:

`CakePlugin::load('Linkable');`

### Configuration

[](#configuration)

To use this behavior, add it to your AppModel:

```
