PHPackages                             markstory/geshi - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. markstory/geshi

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

markstory/geshi
===============

CakePHP plugin that integrates with Geshi Syntax highlighter.

5.0.0(2y ago)252.3k71MITPHPPHP &gt;=8.1

Since Feb 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/markstory/cakephp_geshi)[ Packagist](https://packagist.org/packages/markstory/geshi)[ Docs](https://github.com/markstory/cakephp_geshi)[ RSS](/packages/markstory-geshi/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (5)Versions (15)Used By (1)

Geshi Helper Plugin
-------------------

[](#geshi-helper-plugin)

This plugin provides a simple helper for adding GeSHi syntax highlighting to your application.

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

[](#installation)

You can install the plugin with composer. Add the following your composer.json file:

```
"require": {
	"markstory/geshi": "~3.0"
}
```

After running `composer update` you should also remember to load the plugin. In your application's bootstrap.php file add the following:

```
Plugin::load('Geshi');
```

### Include the helper in your controller

[](#include-the-helper-in-your-controller)

The GeSHi helper offers three different ways to set GeSHi's features, which affects how you will include the helper in your controller.

If you want to use a `geshi.php` configuration file, or you want to set the features from within your view later, make sure to include without pre-configuration. Otherwise if you want to include the features' settings in your helper declaration, include with pre-configuration, both explained next.

### Include without pre-configuration

[](#include-without-pre-configuration)

To use the helper, include the helper in your View:

```
public $helpers = ['Geshi.Geshi'];
```

You will have to include a `geshi.php` configuration file or simply set the features later from your view.

### Include with pre-configuration

[](#include-with-pre-configuration)

To use the helper and specify specific GeSHi features, use the options form of including helpers:

```
public $helpers = [
	'Geshi.Geshi' => [
		'set_header_type' => ['GESHI_FANCY_LINE_NUMBERS', 5]
	]
];
```

Where the passed-in key is a GeSHi function name, and the passed-in values is an array of values for the function. Note that because GeSHi's own constants are out of scope at this point, you must quote named constants as shown above. GeshiHelper will resolve them for you.

### Methods

[](#methods)

**highlight($html)**

This method will scan HTML for `` blocks with a known lang attribute. This method is good for highlighting code samples in blog posts or wiki pages.

You can indicate the language of the text in a `` block by setting the lang attribute. For example:

```

Geshi->features` in your view.

License
-------

[](#license)

This code is licensed under the MIT License.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 84.4% 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 ~339 days

Recently: every ~396 days

Total

12

Last Release

793d ago

Major Versions

v0.3.0 → 3.0.x-dev2015-01-03

3.x-dev → 4.x-dev2019-12-17

4.1.1 → 5.0.02024-04-21

PHP version history (3 changes)v0.2.0PHP &gt;=5.3.0

4.1.0PHP &gt;=7.4.0

5.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24086?v=4)[Mark Story](/maintainers/markstory)[@markstory](https://github.com/markstory)

---

Top Contributors

[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (81 commits)")[![balthisar](https://avatars.githubusercontent.com/u/3053246?v=4)](https://github.com/balthisar "balthisar (12 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![Schlaefer](https://avatars.githubusercontent.com/u/143224?v=4)](https://github.com/Schlaefer "Schlaefer (1 commits)")[![stickler-ci](https://avatars.githubusercontent.com/u/16011037?v=4)](https://github.com/stickler-ci "stickler-ci (1 commits)")

---

Tags

cakephp-plugingeshiphphelpercakephpgeshihighlighting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/markstory-geshi/health.svg)

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

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

333972.2k49](/packages/dereuromark-cakephp-tools)[dereuromark/cakephp-calendar

A CakePHP plugin to easily create calendars.

1674.7k1](/packages/dereuromark-cakephp-calendar)[drmonkeyninja/cakephp-social-share

CakePHP helper for creating social share/bookmark links

31103.5k](/packages/drmonkeyninja-cakephp-social-share)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

3096.0k5](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

35184.7k2](/packages/dereuromark-cakephp-setup)[bedita/manager

BEdita Manager - official admin webapp for BEdita4 API

131.1k](/packages/bedita-manager)

PHPackages © 2026

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