定制 tutida/altair 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tutida/altair

最新稳定版本:1.0.1

Composer 安装命令:

composer require tutida/altair

包简介

Auto converting special characters of variables to HTML entities

README 文档

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);
        }
        ...
    }

统计信息

  • 总下载量: 64.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-11-30