PHPackages                             loadsys/cakephp\_giftwrap - 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. [Templating &amp; Views](/categories/templating)
4. /
5. loadsys/cakephp\_giftwrap

AbandonedCakephp-plugin[Templating &amp; Views](/categories/templating)

loadsys/cakephp\_giftwrap
=========================

A CakePHP Presenter/Decorator Plugin

061PHP

Since Mar 4Pushed 12y ago8 watchersCompare

[ Source](https://github.com/loadsys/CakePHP-GiftWrap)[ Packagist](https://packagist.org/packages/loadsys/cakephp_giftwrap)[ RSS](/packages/loadsys-cakephp-giftwrap/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

CakePHP-GiftWrap
================

[](#cakephp-giftwrap)

[![Build Status](https://camo.githubusercontent.com/a403656d093f46341622699dd503d1d0e5804019d581fe94e3bbb682c53fa4c8/68747470733a2f2f7472617669732d63692e6f72672f6c6f61647379732f43616b655048502d47696674577261702e706e67)](https://travis-ci.org/loadsys/CakePHP-GiftWrap)

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

[](#requirements)

- CakePHP &gt;= 2.1
- PHP 5.3+

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

[](#installation)

### Git

[](#git)

```
git clone git@github.com:loadsys/CakePHP-GiftWrap.git Plugin/GiftWrap
```

### Composer

[](#composer)

- Add to your `composer.json` file

```
"require": {
	"loadsys/cakephp_giftwrap": "dev-master"
}
```

Usage
-----

[](#usage)

1. Ensure the plugin is loaded in `app/Config/bootstrap.php` by calling `CakePlugin::load('GiftWrap', array('bootstrap' => true));`
2. @TODO Complete this section

API
---

[](#api)

### Component API

[](#component-api)

##### PresenterComponent::uses($className)

[](#presentercomponentusesclassname)

- **$className** *String* Class name with or without the Presenter part.

Set the class that will be used for the default presenter.

##### PresenterComponent::viewVar($varName)

[](#presentercomponentviewvarvarname)

- **$varName** *String* Variable name that the default presenter will be set to.

Set the name of the variable the defautl presenter will be set into.

##### PresenterComponent::defaultClass($className)

[](#presentercomponentdefaultclassclassname)

- **$className** *String* Class name with or without the Presenter part.

Set the class that will be used as a fallback if the conventionally named presenter classes don't exist.

##### PresenterComponent::options($options)

[](#presentercomponentoptionsoptions)

- **$options** *Array*
    - contextKey *String* Which property of the Presenter will be the context. Default is `model`.

Set the options array that will be passed to the creation of the default presenter.

##### PresenterComponent::create($className, $data, $options)

[](#presentercomponentcreateclassname-data-options)

- **$className** *String* Class name with or without the Presenter part.
- **$data** *Mixed* Data passed to the creation of the presenter.
- **$options** *Array* Options passed to the creation of the presenter.

Creates a new instance of the supplied presenter class name with the given data and options.

##### PresenterComponent::set($keyOrArray, $value)

[](#presentercomponentsetkeyorarray-value)

- **$keyOrArray** *Mixed* Either a string key or an array of key/value pairs.
- **$value** *Mixed* Value set when first param is a string key.

Set data for the default presenter by either passing a key and value, or an array of key/value pairs.

##### PresenterComponent::setPresenter($key, $className, $data, $options)

[](#presentercomponentsetpresenterkey-classname-data-options)

- **$key** *String* Property on default presenter to set object to.
- **$className** *String* Class name with or without the Presenter part.
- **$data** *Array* Data for the new presenter instance.
- **$options** *Array* Options for the new presenter instance.

Creates an instance of the supplied presenter class name with the data and options and sets it to the key on the default presenter.

##### PresenterComponent::setEachPresenter($key, $className, $array, $options)

[](#presentercomponentseteachpresenterkey-classname-array-options)

- **$key** *String* Property on default presenter to set object to.
- **$className** *String* Class name with or without the Presenter part.
- **$array** *Array* List of data, that each element is wrapped with a presenter.
- **$options** *Array* Options for the new presenter instance.

Creates an iterator that wraps the supplied array. Each element of the array becomes an instance of the supplied presenter class name, where the data is the current element of the array and the options apply to all instances.

##### PresenterComponent::setDecorator($key, $className, $context, $extra, $options)

[](#presentercomponentsetdecoratorkey-classname-context-extra-options)

- **$key** *String* Property on default presenter to set object to.
- **$className** *String* Class name with or without the Presenter part.
- **$context** *Mixed* Data that is set the the contextKey property on the presenter.
- **$extra** *Array* Data for the new presenter instance.
- **$options** *Array* Options for the new presenter instance.

Creates an instance of the supplied presenter class name. The `$context` variable is set to the context property of the presenter, and the `$extra` data is used when creating the presenter.

##### PresenterComponent::setEachDecorator($key, $className, $contexts, $extra, $options)

[](#presentercomponentseteachdecoratorkey-classname-contexts-extra-options)

- **$key** *String* Property on default presenter to set object to.
- **$className** *String* Class name with or without the Presenter part.
- **$contexts** *Array* List of data that is set to the presenters contextKey property.
- **$extra** *Array* Data for the new presenter instance.
- **$options** *Array* Options for the new presenter instance.

Creates an iterator that wraps the contexts. Each context becomes an instance of the supplied presenter class name. The presenter is created with the data supplied in `$extra`, and the context is set to the context property on the presenter instance.

License
-------

[](#license)

[MIT](https://github.com/loadsys/CakePHP-GiftWrap/blob/master/LICENSE.md)

Copyright
---------

[](#copyright)

[Loadsys Web Strategies](http://www.loadsys.com) 2013

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/58c6913a72757502a801ebc71f995eb1c4f7a53a7de7314a20b9a1f1d6131b60?d=identicon)[jtyost2](/maintainers/jtyost2)

![](https://www.gravatar.com/avatar/2380c6ad9546e6c8ce5c5b641f5a4bce0c4d3e7f3a377dc287936dff50cc3064?d=identicon)[ricog](/maintainers/ricog)

---

Top Contributors

[![justinyost](https://avatars.githubusercontent.com/u/85320?v=4)](https://github.com/justinyost "justinyost (11 commits)")[![joeytrapp](https://avatars.githubusercontent.com/u/283946?v=4)](https://github.com/joeytrapp "joeytrapp (6 commits)")[![ricog](https://avatars.githubusercontent.com/u/66134?v=4)](https://github.com/ricog "ricog (5 commits)")[![loadsysworker](https://avatars.githubusercontent.com/u/6012948?v=4)](https://github.com/loadsysworker "loadsysworker (2 commits)")[![alecho](https://avatars.githubusercontent.com/u/1035853?v=4)](https://github.com/alecho "alecho (1 commits)")

### Embed Badge

![Health badge](/badges/loadsys-cakephp-giftwrap/health.svg)

```
[![Health](https://phpackages.com/badges/loadsys-cakephp-giftwrap/health.svg)](https://phpackages.com/packages/loadsys-cakephp-giftwrap)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
