本文整理汇总了PHP中ArrayUtils::has_value方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtils::has_value方法的具体用法?PHP ArrayUtils::has_value怎么用?PHP ArrayUtils::has_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayUtils
的用法示例。
在下文中一共展示了ArrayUtils::has_value方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: require_css
public static function require_css($css_path, $media = CSS::MEDIA_ALL)
{
self::init_css();
if (!ArrayUtils::has_value(self::$css_elements, $css_path)) {
self::$css_elements[] = $css_path;
PageData::instance()->add("/page/headers/required_css_files/css_file_list", array("path" => $css_path, "media" => $media));
}
}
示例2: raw
public static function raw($key, $script)
{
self::init_javascript();
if (!ArrayUtils::has_value(self::$scripts, $key)) {
self::$scripts[$key] = $script;
$p = array(Block::MARKER_KEY => "head/raw_javascript", "raw_script" => $script);
PageData::instance()->add("/page/headers/required_javascripts/list", $p);
}
}
示例3: testHasValue
function testHasValue()
{
$data = array(1 => "ciao", 2 => "mondo");
$this->assertTrue(ArrayUtils::has_value($data, "ciao"));
$this->assertTrue(ArrayUtils::has_value($data, "mondo"));
$this->assertFalse(ArrayUtils::has_value($data, "pippo"));
$this->assertFalse(ArrayUtils::has_value($data, 0));
$this->assertFalse(ArrayUtils::has_value($data, 1));
$this->assertFalse(ArrayUtils::has_value($data, 2));
$this->assertFalse(ArrayUtils::has_value($data, 3));
}
示例4: get_all_available_categories
static function get_all_available_categories()
{
//moduli primari
$modules_root = new Dir(DS . ModuleUtils::get_modules_path());
$all_folders = $modules_root->listFolders();
$result = array();
foreach ($all_folders as $cat) {
if ($cat->isDir()) {
$result[] = $cat->getName();
}
}
//aggiungo la categoria framework se non è presente.
if (!ArrayUtils::has_value($result, ModuleUtils::FRAMEWORK_CATEGORY_NAME)) {
$result[] = ModuleUtils::FRAMEWORK_CATEGORY_NAME;
}
//ok
return $result;
}
示例5: testListFiles
function testListFiles()
{
$d = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/io/list_files_test/");
$this->assertEqual(count($d->listFiles()), 2, "Il numero di file col list di default non corrisponde!!");
$this->assertEqual(count($d->listFiles(Dir::DEFAULT_EXCLUDES)), 2, "Il numero di file col list di default non corrisponde!!");
$this->assertEqual(count($d->listFiles(Dir::NO_HIDDEN_FILES)), 2, "Il numero di file col list di default non corrisponde!!");
$this->assertTrue(count($d->listFiles(Dir::SHOW_HIDDEN_FILES)) >= 3, "Il numero di file col list dei file nascosti non corrisponde!!");
$expected_names = array(".htaccess", ".svn", "plain.txt", "a_dir");
$files = $d->listFiles(Dir::SHOW_HIDDEN_FILES);
foreach ($files as $f) {
if ($f->isDir()) {
$this->assertTrue(ArrayUtils::has_value($expected_names, $f->getName()));
} else {
$this->assertTrue(ArrayUtils::has_value($expected_names, $f->getFilename()));
}
}
}
示例6: isEnabled
static function isEnabled($l)
{
return ArrayUtils::has_value(self::$enabled_languages, $l);
}
示例7: has_database
function has_database($database_name)
{
$database_list = $this->get_database_list();
return ArrayUtils::has_value($database_list, $database_name);
}