本文整理匯總了PHP中ElementHelper::build_element_file_path方法的典型用法代碼示例。如果您正苦於以下問題:PHP ElementHelper::build_element_file_path方法的具體用法?PHP ElementHelper::build_element_file_path怎麽用?PHP ElementHelper::build_element_file_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ElementHelper
的用法示例。
在下文中一共展示了ElementHelper::build_element_file_path方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
// If file has been updated, update the element and sync
if ($file['mod_time'] > $element_sync->get_element_mod_time($type, $file['name'])) {
$properties = $element_helper->get_file_element_properties($type_path, $file_path);
if ($element->set_properties($properties)) {
$element_sync->add_element($type, $file['name'], $file['mod_time']);
}
}
}
}
}
// Process the elements for this element type
foreach ($modx->getCollection($type) as $element_object) {
$element = Element::insert($element_object);
$name = $element->get_property('name');
$category_id = $element->get_property('category');
$file_path = $element_helper->build_element_file_path($type, $type_path, $name, $category_id);
// Check if the element is blacklisted
if (in_array($name, $element_blacklist)) {
continue;
}
// Check if the element has a category and is whitelisted
if ($category_id !== 0) {
$category = Element::get($modx, 'modCategory', $category_id);
if (!in_array($category->get_property('name'), $category_whitelist)) {
continue;
}
}
// If a file with this element name doesn't exist
if (!file_exists($file_path)) {
// If the element is not in the sync
if (!$element_sync->has_element($type, $name)) {