本文整理汇总了PHP中item::property_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP item::property_exists方法的具体用法?PHP item::property_exists怎么用?PHP item::property_exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item
的用法示例。
在下文中一共展示了item::property_exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nvweb_conditional
//.........这里部分代码省略.........
$item_type = 'element';
} else {
if (!isset($vars['scope']) || $vars['scope'] == 'structure') {
$item = $current['object'];
$item_type = 'structure';
}
}
}
// get the template
$item_html = $vars['_template'];
// now, parse the conditional tags (with html source code inside)
switch ($vars['by']) {
case 'property':
$property_value = NULL;
$property_name = $vars['property_name'];
if (empty($vars['property_name'])) {
$property_name = $vars['property_id'];
}
if ($vars['property_scope'] == "element") {
$property_value = $item->property($property_name);
} else {
if ($vars['property_scope'] == "structure") {
$property = nvweb_properties(array('mode' => 'structure', 'property' => $property_name, 'return' => 'object'));
if (!empty($property)) {
$property_value = $property->value;
}
} else {
if ($vars['property_scope'] == "website") {
$property_value = $website->theme_options->{$property_name};
} else {
// no scope defined, so we have to check ELEMENT > STRUCTURE > WEBSITE (the first with a property with the given name)
// element
$property_value = $item->property($property_name);
if (!$item->property_exists($property_name) && $item_type == 'structure') {
// get the first embedded element and check find the property
$ci = nvweb_content_items(array($item->id), true, 1, true, 'priority');
$item = new item();
if (isset($ci[0])) {
$item->load($ci[0]->id);
$property_value = $item->property($property_name);
}
}
if (!$item->property_exists($property_name)) {
// structure
$property = nvweb_properties(array('mode' => 'structure', 'property' => $property_name, 'return' => 'object'));
if (!empty($property)) {
$property_value = $property->value;
} else {
// website
if (isset($website->theme_options->{$property_name})) {
$property_value = $website->theme_options->{$property_name};
} else {
$property_value = '';
}
}
}
}
}
}
// if the property is multilanguage, get the value for the current language
if (is_array($property_value)) {
$property_value = $property_value[$current['lang']];
}
// check the given condition
if (isset($vars['empty']) || isset($vars['property_empty'])) {
if (@$vars['empty'] == 'true' || @$vars['property_empty'] == 'true') {