PHPackages                             amashigeseiji/viewvalue - 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. amashigeseiji/viewvalue

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

amashigeseiji/viewvalue
=======================

ViewValue plugin for CakePHP

0.9.0(10y ago)146MITPHPPHP &gt;=5.5

Since Jun 18Pushed 10y ago1 watchersCompare

[ Source](https://github.com/amashigeseiji/cake_ViewValue)[ Packagist](https://packagist.org/packages/amashigeseiji/viewvalue)[ Docs](https://github.com/amashigeseiji/cake_ViewValue)[ RSS](/packages/amashigeseiji-viewvalue/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

ViewValue Plugin for CakePHP
============================

[](#viewvalue-plugin-for-cakephp)

[![Build Status](https://camo.githubusercontent.com/eb06fece7de0f4cdc9e3b6f95d2fb9b3a598fad34aee5b8b7b889e892f2a289f/68747470733a2f2f7472617669732d63692e6f72672f616d6173686967657365696a692f63616b655f5669657756616c75652e7376673f6272616e63683d646576)](https://travis-ci.org/amashigeseiji/cake_ViewValue) [![Coverage Status](https://camo.githubusercontent.com/66642ea707ec765651f5fa67120616866c96670ac30b279d8b5ac4f4a72f2a55/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f616d6173686967657365696a692f63616b655f5669657756616c75652f62616467652e7376673f6272616e63683d646576)](https://coveralls.io/r/amashigeseiji/cake_ViewValue?branch=dev)

This plugin let your CakePHP application secure against XSS injection by escaping View variables automatically.

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

[](#requirements)

- PHP &gt;= 5.5
- CakePHP &gt;= 2.6

Setup
-----

[](#setup)

In `Config/bootstrap.php`:

```
#Load ViewValue plugin
CakePlugin::load('ViewValue');
```

and in `Controller/AppController.php`:

```
public $helpers = array('ViewValue.ViewValue');
```

#### notice

[](#notice)

If variables are already escaped by using `h()` helper in your view file, you should remove `h()`.
They might to be cause of double escaping.

Description
-----------

[](#description)

This plugin convert View variable whose type is `String`/`Array`/`Object` into instance of `StringViewValue`/`ArrayViewValue`/`ObjectViewValue`.
They act as their original variable type.
If need arise, you can get raw value by calling `raw()` method in view file.

Sample code
-----------

[](#sample-code)

`StringViewValue` act as string.

```
#Controller/SampleController.php
public function index() {
	$this->set('xssstr', 'alert(0)');
}
```

```

raw(); ?>
```

and `ArrayViewValue` act as array.

```
#Controller/SampleController.php
public function index() {
	$this->set('arr', array('alert(0)', 'hoge', array('fuga', array('hoge', 'fuga'))));
}
```

```

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~2 days

Total

3

Last Release

3983d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e4ecb44cd8b1fce62a4b9a2a32f49e43aee24d329a32c7543fff89171381fe2?d=identicon)[tenjuu99](/maintainers/tenjuu99)

---

Top Contributors

[![amashigeseiji](https://avatars.githubusercontent.com/u/1837070?v=4)](https://github.com/amashigeseiji "amashigeseiji (17 commits)")

---

Tags

cakephpautoEscape

### Embed Badge

![Health badge](/badges/amashigeseiji-viewvalue/health.svg)

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

###  Alternatives

[friendsofcake/cakephp-csvview

A CSV View class for CakePHP

1762.5M3](/packages/friendsofcake-cakephp-csvview)[wyrihaximus/twig-view

Twig powered View for CakePHP

804.7M1](/packages/wyrihaximus-twig-view)[a2lix/auto-form-bundle

Automate form building

873.8M11](/packages/a2lix-auto-form-bundle)[aura/view

Provides an implementation of the TemplateView and TwoStepView patterns, with support for helpers and for closures as templates, using PHP itself as the templating language.

88152.8k19](/packages/aura-view)[dereuromark/cakephp-ajax

A CakePHP plugin that makes working with AJAX a piece of cake.

55255.9k1](/packages/dereuromark-cakephp-ajax)[nystudio107/craft-autocomplete

Provides Twig template IDE autocomplete of Craft CMS &amp; plugin variables

44204.4k13](/packages/nystudio107-craft-autocomplete)

PHPackages © 2026

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