本文整理汇总了PHP中FieldManager::__getHandleFromFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldManager::__getHandleFromFilename方法的具体用法?PHP FieldManager::__getHandleFromFilename怎么用?PHP FieldManager::__getHandleFromFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldManager
的用法示例。
在下文中一共展示了FieldManager::__getHandleFromFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchTypes
/**
* Returns an array of all available field handles discovered in the
* `TOOLKIT . /fields` or `EXTENSIONS . /{}/fields`.
*
* @return array
* A single dimensional array of field handles.
*/
public function fetchTypes()
{
$structure = General::listStructure(TOOLKIT . '/fields', '/field.[a-z0-9_-]+.php/i', false, 'asc', TOOLKIT . '/fields');
$extensions = Symphony::ExtensionManager()->listInstalledHandles();
if (is_array($extensions) && !empty($extensions)) {
foreach ($extensions as $handle) {
if (is_dir(EXTENSIONS . '/' . $handle . '/fields')) {
$tmp = General::listStructure(EXTENSIONS . '/' . $handle . '/fields', '/field.[a-z0-9_-]+.php/i', false, 'asc', EXTENSIONS . '/' . $handle . '/fields');
if (is_array($tmp['filelist']) && !empty($tmp['filelist'])) {
$structure['filelist'] = array_merge($structure['filelist'], $tmp['filelist']);
}
}
}
$structure['filelist'] = General::array_remove_duplicates($structure['filelist']);
}
$types = array();
foreach ($structure['filelist'] as $filename) {
$types[] = FieldManager::__getHandleFromFilename($filename);
}
return $types;
}