PHPackages                             hugodias/cakegallery - 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. hugodias/cakegallery

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

hugodias/cakegallery
====================

Gallery plugin for CakePHP

2927.3k↓50%22[4 issues](https://github.com/hugodias/cakegallery/issues)[1 PRs](https://github.com/hugodias/cakegallery/pulls)PHP

Since Jan 13Pushed 10y ago5 watchersCompare

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

READMEChangelog (6)DependenciesVersions (2)Used By (0)

Cake Gallery
============

[](#cake-gallery)

[!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/hugodias/cakegallery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

CakeGallery is a cakephp plugin to manage galleries, albums and pictures

[![Album page](https://camo.githubusercontent.com/ec28f395dc2f6ea62f7e1f11373ffe4d7fc898345f3c56c7b27c852e80e0c5e5/687474703a2f2f692e696d6775722e636f6d2f725261756259772e706e67)](https://www.youtube.com/watch?v=3gHRnCI2vHE)

With CakeGallery you can:

- Create Albums
- Add tags, title and status (published or drafts) to albums
- Upload multiple pictures at the same time
- Create multiple versions for your pictures (thumbnails, crop, resize, etc)
- Integrate any album with any other Model in your application

---

### Videos and Resources

[](#videos-and-resources)

Installing:  - Portuguese

Features:

DEMO (Old version):

---

### Requirements

[](#requirements)

To use CakeGallery you need the following requirements

- CakePHP 2.x application
- PHP 5.3+ (bundled GD 2.0.28+ for image manipulation)
- MySQL
- Apache

---

### Version

[](#version)

2.0.0

---

### Before start

[](#before-start)

- Make sure that your `app/webroot/files` folder is writable

---

### Wizard Installation (recommended)

[](#wizard-installation-recommended)

- Clone or Download the Zip file from Github
- Copy the `Gallery` folder to your app plugins folder: `app/Plugin/`
- Make sure that your `app/Plugin/Gallery/Config` folder is writable (For installation only)
- Open your `app/Config/bootstrap.php` file and add the following code

```
CakePlugin::load(array(
	'Gallery' => array(
    'bootstrap' => true,
    'routes' => true
)));
```

- To finish the installation go to your browser and type `http://your-app-url/gallery` and follow the wizard

---

### Manual installation

[](#manual-installation)

- Clone or Download the Zip file from Github
- Copy the `Gallery` folder to your app plugins folder: `app/Plugin/`
- Rename the `app/Plugin/Gallery/Config/config.php.install` file to **config.php**
- Import the SQL file `app/Plugin/Gallery/Config/cakegallery.sql` to your database
- Open your `app/Config/bootstrap.php` file and add the following code

```
CakePlugin::load(array(
	'Gallery' => array(
   	'bootstrap' => true,
    'routes' => true
)));
```

- Create a **gallery** folder inside `app/webroot/files` and give it writable permissions. (`app/webroot/files/gallery`)
- Check at `http://your-app-url/gallery` to see your plugin working.

---

### FAQ

[](#faq)

---

#### The images are not showing up

[](#the-images-are-not-showing-up)

If you are using windows , have a chance of the images are not being rendered. This will happen because of windows directory separator. To fix it you can use this solution:

#### How to attach a gallery to a model?

[](#how-to-attach-a-gallery-to-a-model)

Integrating Gallery with a model of your application is very simple and takes only seconds, and the best is you do not need to change your database. To begin open the model you want to attach a gallery, in this example will be `Product.php`

```
class Product extends AppModel{
    public $name = 'Product';
}
```

Now you just need to add the $actsAs attribute in your model:

```
class Product extends AppModel{
	public $name = 'Product';
	public $actsAs = array('Gallery.Gallery');
}
```

And its done! Now, when you search for this object in database, its pictures will be automatically retrieved from the plugin:

```
$product = $this->Product->findById(10);
//
// array(
//   'Product' => array(
//     'id' => '1',
//     'name' => 'My Product',
//     'price' => '29.00'
//   ),
//   'Gallery' => array(
//     'Album' => array(
//       ...
//     ),
//     'Picture' => array(
//       ...
//     ),
//     'numPictures' => (int) 2
//   )
// )
```

If you want to manually call for the pictures you will want to disable the automatic feature and call it yourself:

```
public $actsAs = array('Gallery.Gallery' => array('automatic' => false));
```

```
// Anycontroller.php
$this->Product->id = 10;
$this->Product->getGallery();
```

---

#### How to create a new gallery attached with a model?

[](#how-to-create-a-new-gallery-attached-with-a-model)

You should use the Gallery link helper. It is very easy to use.

1. Specify the Gallery helper in your controller
2. Use the gallery link helper passing a model and id

```
# ProductsController.php
class ProductsController extends AppController {
	public $helpers = array('Gallery.Gallery');
}
```

```
# app/View/Products/view.ctp
echo $this->Gallery->link('product', 10);
```

---

#### How to create a standalone gallery? (Non-related gallery)

[](#how-to-create-a-standalone-gallery-non-related-gallery)

You can create a gallery that don't belongs to any model, a standalone gallery. To create one of those you will use the same example as above, but no arguments are needed

```
# anyview.ctp
echo $this->Gallery->link();
```

---

#### How to change image resize dimensions?

[](#how-to-change-image-resize-dimensions)

All configuration related to images you can find at app/Plugin/Gallery/Config/bootstrap.php

```
$config = array(
	'App' => array(
		# Choose what theme you want to use:
		# You can find all themes at Gallery/webroot/css/themes
		# Use the first name in the file as a parameter, eg: cosmo.min.css -> cosmo
		'theme' => 'cosmo'
	),
	'File' => array(
		# Max size of a file (in megabytes (MB))
		'max_file_size' => '20',

		# What king pictures the user is allowed to upload?
		'allowed_extensions' => array('jpg','png','jpeg','gif')
	),
	'Pictures' => array(
		# Resize original image. If you don't want to resize it, you should set a empty array, E.G: 'resize_to' => array()
		# Default configuration will resize the image to 1024 pixels height (and unlimited width)
		'resize_to' => array(0, 1024, false),

		# Set to TRUE if you want to convert all png files to JPG (reduce significantly image size)
		'png2jpg' => true,

		# Set the JPG quality on each resize.
		# The recommended value is 85 (85% quality)
		'jpg_quality' => 85,

		# List of additional files generated after upload, like thumbnails, banners, etc
		'styles' => array(
			'small' => array(50, 50, true), # 50x50 Cropped
			'medium' => array(255, 170, true), # 255#170 Cropped
			'large' => array(0, 533, false) # 533 pixels height (and unlimited width)
			)
		)
	);
	Configure::write('GalleryOptions', $config);
```

You can create as many styles you want, just add in the styles array, and future versions will be created on uploading.

PS: DO NOT modify the default names as **medium** or **small**. You can safely modify the width, height and action but the names are used by the plugin, so don't change then.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

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://avatars.githubusercontent.com/u/513352?v=4)[Hugo Dias](/maintainers/hugodias)[@hugodias](https://github.com/hugodias)

---

Top Contributors

[![hugodias](https://avatars.githubusercontent.com/u/513352?v=4)](https://github.com/hugodias "hugodias (143 commits)")[![ptica](https://avatars.githubusercontent.com/u/169873?v=4)](https://github.com/ptica "ptica (2 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

### Embed Badge

![Health badge](/badges/hugodias-cakegallery/health.svg)

```
[![Health](https://phpackages.com/badges/hugodias-cakegallery/health.svg)](https://phpackages.com/packages/hugodias-cakegallery)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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