本文整理汇总了PHP中Filters::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP Filters::bind方法的具体用法?PHP Filters::bind怎么用?PHP Filters::bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filters
的用法示例。
在下文中一共展示了Filters::bind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginHandle
public static function loginHandle()
{
if (check_post('cc_login_uname', 'cc_login_passwd', 'cc_login_login')) {
// for security, we don't want session fixation :(
session_regenerate_id();
$_SESSION['uname'] = $_POST['cc_login_uname'];
$_SESSION['pword'] = hash('whirlpool', $_POST['cc_login_passwd']);
$_SESSION['last_ip'] = $_SERVER['REMOTE_ADDR'];
$_SESSION['last_user_agent'] = $_SERVER['HTTP_USER_AGENT'];
if (self::checkSession()) {
//var_dump(TH_PUB_ADMIN);exit();
if ($_POST['cc_login_remember'] == "yes") {
$host = $_SERVER['HTTP_HOST'];
if (substr($host, 0, 4) == "www.") {
$host = substr($host, 3);
}
setcookie('ln', self::packCookie(), time() + 60 * 60 * 24 * 30 * 12);
}
cc_redirect(TH_PUB_ADMIN, true);
} else {
Filters::bind('post_output_login', 'Users::outputError');
}
}
}
示例2: filter
/**
* A wrapper for Filters::bind();
*/
public function filter($hook, $callback, $priority = 0)
{
$this->filters[] = array($hook, $callback);
Filters::bind($hook, $callback, $priority);
}
示例3: foreach
{
if (is_array($name)) {
if (is_null($value)) {
foreach ($name as $key => $val) {
self::$tokens[$key] = $val;
}
} else {
foreach ($name as $key => $val) {
self::$tokens[$val] = $value[$key];
}
}
} else {
self::$tokens[$name] = $value;
}
}
public static function registerDefaults()
{
Tokens::register(array("theme_dir" => Themes::$curr_theme->getPublicPath(), "public_root" => TH_PUB_ROOT, "root" => TH_ROOT, "public_content_dir" => TH_PUB_ROOT . TH_CONTENT, "content_dir" => TH_ROOT . TH_CONTENT, "uploads_dir" => TH_ROOT . TH_UPLOADS, "public_uploads_dir" => TH_PUB_ROOT . TH_UPLOADS));
}
public static function fetch($name)
{
return self::$tokens[$name];
}
public static function filter($value)
{
return Tokenizer::perform($value, self::$tokens);
}
}
Hooks::bind("system_after_themes_load", "Tokens::registerDefaults");
Filters::bind("content_get_inital", "Tokens::filter");