本文整理汇总了PHP中Floxim\Floxim\System\Fx::getComponentParts方法的典型用法代码示例。如果您正苦于以下问题:PHP Fx::getComponentParts方法的具体用法?PHP Fx::getComponentParts怎么用?PHP Fx::getComponentParts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floxim\Floxim\System\Fx
的用法示例。
在下文中一共展示了Fx::getComponentParts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: templates
public function templates($component, $input)
{
// todo: psr0 need verify
$ctr_type = fx::getComponentNameByClass(get_class($component));
$this->response->submenu->setSubactive('templates');
if (isset($input['params'][2])) {
$res = $this->template(array('template_full_id' => $input['params'][2]));
if ($res === false) {
return array('reload' => '#admin.' . $ctr_type . '.edit(' . $input['params'][0] . ',templates)');
}
return $res;
}
$templates = $this->getComponentTemplates($component);
$visuals = fx::data('infoblock_visual')->where('template', $templates->getValues('full_id'))->all();
$field = array('type' => 'list', 'filter' => true);
$field['labels'] = array('name' => fx::alang('Name', 'system'), 'action' => fx::alang('Action', 'system'), 'inherited' => fx::alang('Inherited', 'system'), 'source' => fx::alang('Source', 'system'), 'file' => fx::alang('File', 'system'), 'used' => fx::alang('Used', 'system'));
$field['values'] = array();
foreach ($templates as $tpl) {
$r = array('id' => $tpl['full_id'], 'name' => array('name' => $tpl['name'], 'url' => $ctr_type . '.edit(' . $component['id'] . ',templates,' . $tpl['full_id'] . ')'), 'action' => preg_replace("~^.+\\:~", '', $tpl['of']), 'used' => count($visuals->find('template', $tpl['full_id'])));
$owner_ctr_match = null;
preg_match("~^(component_|widget_)?(.+?)\\..+\$~", $tpl['of'], $owner_ctr_match);
$owner_ctr = $owner_ctr_match ? $owner_ctr_match[2] : null;
if ($owner_ctr == $component['keyword']) {
$r['inherited'] = ' ';
} else {
$r['inherited'] = $owner_ctr;
}
// example: theme.floxim.phototeam:featured_news_list
if (preg_match("#^theme\\.(\\w+)\\.(\\w+)\\:.+\$#i", $tpl['full_id'], $match)) {
// todo: psr0 need use $match[1] for define vendor template
$r['source'] = fx::data('layout')->where('keyword', $match[1] . '.' . $match[2])->one()->get('name') . ' (layout)';
} else {
// todo: psr0 need verify
$c_parts = fx::getComponentParts($tpl['full_id']);
$r['source'] = fx::data($ctr_type, $c_parts['vendor'] . '.' . $c_parts['module'] . '.' . $c_parts['component'])->get('name');
}
$r['file'] = fx::path()->http($tpl['file']);
$field['values'][] = $r;
}
return array('fields' => array('templates' => $field));
}