PHPackages                             ivanamat/cakephp3-documents - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ivanamat/cakephp3-documents

ActiveCakephp-plugin[Parsing &amp; Serialization](/categories/parsing)

ivanamat/cakephp3-documents
===========================

CakePHP 3.x - Markdown Documents

1.0.1(9y ago)21.2k1MITPHPPHP &gt;=5.4.16

Since Aug 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ivanamat/cakephp3-documents)[ Packagist](https://packagist.org/packages/ivanamat/cakephp3-documents)[ Docs](https://github.com/ivanamat/cakephp3-documents)[ RSS](/packages/ivanamat-cakephp3-documents/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

CakePHP 3.x - Markdown Documents
================================

[](#cakephp-3x---markdown-documents)

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

[](#installation)

### Composer {#composer}

[](#composer-composer)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require ivanamat/cakephp3-documents

```

### Git submodule {#gitsubmodule}

[](#git-submodule-gitsubmodule)

```
    git submodule add git@github.com:ivanamat/cakephp3-documents.git plugins/Documents
    git submodule init
    git submodule update

```

### Manual installation

[](#manual-installation)

Download the .zip or .tar.gz file, unzip and rename the plugin folder "cakephp3-documents" to "Documents" then copy the folder to your plugins folder.

Configuration
-------------

[](#configuration)

### Load plugin

[](#load-plugin)

```
    Plugin::load('Documents', ['bootstrap' => false, 'routes' => true]);
```

### Database

[](#database)

Import documents.sql `config/cheme/documents.sql` or execute the SQL commands.

```
    # documents.sql

    DROP TABLE IF EXISTS `categories`;
    CREATE TABLE `categories` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `parent_id` int(11) DEFAULT NULL,
      `lft` int(11) DEFAULT NULL,
      `rght` int(11) DEFAULT NULL,
      `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
      `public` tinyint(1) NOT NULL DEFAULT '0',
      `created` datetime NOT NULL,
      `modified` datetime DEFAULT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `slug` (`slug`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    DROP TABLE IF EXISTS `documents`;
    CREATE TABLE `documents` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `category_id` int(11) DEFAULT NULL,
      `user_id` int(11) NOT NULL,
      `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
      `body` text COLLATE utf8_unicode_ci,
      `created` datetime DEFAULT NULL,
      `modified` datetime DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
```

### Bootstrap

[](#bootstrap)

Set in your bootstrap file `src/config/bootstrap.php`.

Specify your homepage's URL.

```
    Configure::write('Documents.home', ['plugin' => false, 'controller' => 'Pages', 'action' => 'display', 'home']);
```

Create your own INDEX.md and specify the path.

```
    Configure::write('Documents.index', '../INDEX.md');
```

If the ACL plugin is loaded, you can set action's permissions.

```
    /**
     * Allow CategoriesController actions
     * @actions: index, edit
     */
    Configure::write('Categories.auth.allow', ['index','edit']);

    /**
     * Allow DocumentsController actions
     * @actions: index, view, add, edit, delete
     **/
    Configure::write('Documents.auth.allow', ['index','view']);
```

Component and Helper
--------------------

[](#component-and-helper)

Documents has a component named DocsComponent and a helper named DocsHelper, both with the same methods.

Methods
-------

[](#methods)

### slugCategory($id)

[](#slugcategoryid)

**$id** int Category id

**return** string Returns category slug

```
    $slug = $this->Docs->slugCategory($id);
    # Example $slug value: 'proyectos/cakephp/plugins'
    echo ''.$category->title.'';
```

### slugDocument($id)

[](#slugdocumentid)

**$id** int

**return** string Returns document slug

```
    $slug = $this->Docs->slugDocument($id);
    # Example $slug value: 'proyectos/cakephp/plugins/cakephp-3-x-markdown-documents'
    echo ''.$document->title.'';
```

### getCategory($id)

[](#getcategoryid)

**$id** int Category id

**return** object Category

```
    $category = $this->Docs->getCategory($id);
    echo ''.$category->title.'';
```

### getParentSlug($slug)

[](#getparentslugslug)

**$slug** string Slug

**return** string Parent slug

```
    # $slug = 'projects/cakephp/plugins/cakephp-3-x-markdown-documents'
    $parentSlug = $this->Docs->getParentSlug($slug);
    # $parentSlug will output 'projects/cakephp/plugins'
    echo 'Parent category';
```

### getRelatedDocuments($id)

[](#getrelateddocumentsid)

**$id** int Category id

**return** array Array of documents from categories children of the specified category

```
    $relatedDocuments = $this->Docs->getParentSlug($slug);
    foreach($relatedDocuments as $document) {
        echo '' . $document->title . '';
        echo $this->Markdown->parse($document->body);
    }
```

About CakePHP 3.x - Markdown Documents
--------------------------------------

[](#about-cakephp-3x---markdown-documents)

CakePHP 3.x - Markdown Documents require [CakePHP 3.x - Markdown](https://github.com/ivanamat/cakephp3-markdown) plugin.

### Friendly URLs!

[](#friendly-urls)

The **URLs** generated are all **friendly**.

Example:

Author
------

[](#author)

Iván Amat on [GitHub](https://github.com/ivanamat)
[www.ivanamat.es](http://www.ivanamat.es/)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~8 days

Total

2

Last Release

3596d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/52491748e5e20d24a31cbada12e13465ca2ce6c72f60d3908c422c3717fd1b58?d=identicon)[ivanamat](/maintainers/ivanamat)

---

Top Contributors

[![ivanamat](https://avatars.githubusercontent.com/u/14802779?v=4)](https://github.com/ivanamat "ivanamat (16 commits)")

---

Tags

pluginextracakephpmarkdowncakephp3parsedowndocumentscake3

### Embed Badge

![Health badge](/badges/ivanamat-cakephp3-documents/health.svg)

```
[![Health](https://phpackages.com/badges/ivanamat-cakephp3-documents/health.svg)](https://phpackages.com/packages/ivanamat-cakephp3-documents)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

3361.0M51](/packages/dereuromark-cakephp-tools)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131240.2k13](/packages/dereuromark-cakephp-tinyauth)[cakephp/bake

Bake plugin for CakePHP

11212.0M194](/packages/cakephp-bake)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

36199.6k2](/packages/dereuromark-cakephp-setup)[tovic/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5934.5k](/packages/tovic-parsedown-extra-plugin)[taufik-nurrohman/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5932.6k](/packages/taufik-nurrohman-parsedown-extra-plugin)

PHPackages © 2026

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