当前位置: 首页>>代码示例>>PHP>>正文


PHP Sanitizer::getInstance方法代码示例

本文整理汇总了PHP中Sanitizer::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Sanitizer::getInstance方法的具体用法?PHP Sanitizer::getInstance怎么用?PHP Sanitizer::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sanitizer的用法示例。


在下文中一共展示了Sanitizer::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($state = null)
 {
     parent::__construct('forgotPasswordForm', 'Reset password');
     if ($state == null) {
         $this->state = Sanitizer::getInstance()->filterUint('state');
     } else {
         $this->state = $state;
     }
     $this->addElement(new ElementHidden('state', null, $this->state));
     switch ($this->state) {
         case self::STATE_USER_PROVIDE_EMAIL:
             $this->constructUserProvideEmail();
             break;
         case self::STATE_USER_PROVIDE_SECRET:
             $this->constructUserProvideSecret();
             break;
         default:
             throw new InvalidArgumentException('Unknown form state: ' . $this->state);
     }
     $this->addButtons(Form::BTN_SUBMIT);
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:21,代码来源:FormResetPassword.php

示例2: testGetInstance

 /**
  * @covers Xoops\Core\Text\Sanitizer::getInstance
  */
 public function testGetInstance()
 {
     $actual = Sanitizer::getInstance();
     $this->assertInstanceOf('\\Xoops\\Core\\Text\\Sanitizer', $actual);
     $this->assertSame($this->object, $actual);
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:9,代码来源:SanitizerTest.php

示例3:

<?php

require_once 'includes/widgets/header.php';
$groupId = Sanitizer::getInstance()->filterUint('id');
$sql = 'SELECT g.id, g.title FROM groups g WHERE g.id = :id';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':id', $groupId);
$stmt->execute();
$tpl->assign('itemGroup', $stmt->fetchRow());
$sql = 'SELECT u.id, "secondary" as source, u.username FROM group_memberships m LEFT JOIN users u ON m.user = u.id WHERE m.group = :id1 UNION SELECT u.id, "primary" as source, u.username FROM users u WHERE u.group = :id2';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':id1', $groupId);
$stmt->bindValue(':id2', $groupId);
$stmt->execute();
$tpl->assign('listMembers', $stmt->fetchAll());
$sql = 'SELECT p.`key`, p.description FROM privileges_g gp LEFT JOIN permissions p ON gp.permission = p.id WHERE gp.group = :gid';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':gid', $groupId);
$stmt->execute();
$tpl->assign('listPrivileges', $stmt->fetchAll());
$tpl->display('viewGroup.tpl');
require_once 'includes/widgets/footer.php';
开发者ID:jamesread,项目名称:lanlist.org,代码行数:22,代码来源:viewGroup.php


注:本文中的Sanitizer::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。