本文整理匯總了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') {