tutida / altair
There is no license information available for the latest version (1.0.1) of this package.
Auto converting special characters of variables to HTML entities
1.0.1
2018-09-03 02:39 UTC
Requires
- php: >=5.4.16
- cakephp/cakephp: ~3.5
Requires (Dev)
README
Auto converting special characters of variables to HTML entities
Requirements
- PHP >=5.4.16
- CakePHP >= ~3.0
Usage
<?php class AppController extends Controller { public function initialize() { $this->loadComponent('Altair.Altair'); } ... }
By doing above, You do not have to write the following(h()) every time.
<?= h($variable); ?>
If you do not want to escape $object, use $object->escape property.
<?php class UsersController extends AppController { public function add() { $user = $this->Users->newEntity(); ... $user->escape = false; $this->set('user', $user); } ... }
If you do not want to escape in the action, use $this->Altair->escape() method.
<?php class UsersController extends AppController { public function add() { $user = $this->Users->newEntity(); ... // Not escape $viewVars in this action. $this->Altair->escape(false); $this->set('user', $user); } ... }