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 1mo 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

42

—

FairBetter than 89% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity27

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

748d 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://www.gravatar.com/avatar/1efd7167fe426440c421f477c4e808464bc244dea2f5a9786c94db60732f0870?d=identicon)[markstory](/maintainers/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

[drmonkeyninja/cakephp-social-share

CakePHP helper for creating social share/bookmark links

34103.3k](/packages/drmonkeyninja-cakephp-social-share)[dereuromark/cakephp-calendar

A CakePHP plugin to easily create calendars.

1646.8k1](/packages/dereuromark-cakephp-calendar)[dereuromark/cakephp-dto

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

2988.9k3](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-url-cache

CakePHP plugin to speed up URL reverse lookup

24117.2k](/packages/dereuromark-cakephp-url-cache)[torifat/cake-menu_builder

A dynamic menu building helper for CakePHP 2.x

755.6k](/packages/torifat-cake-menu-builder)[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.5k2](/packages/codaxis-cakephp-bootstrap3-helpers)

PHPackages © 2026

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