本文整理汇总了PHP中BaseObject::install_meta方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::install_meta方法的具体用法?PHP BaseObject::install_meta怎么用?PHP BaseObject::install_meta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::install_meta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Type
<?php
# Movable Type (r) (C) 2001-2015 Six Apart, Ltd. All Rights Reserved.
# This code cannot be redistributed without permission from www.sixapart.com.
# For more information, consult your Movable Type license.
#
# $Id$
require_once 'class.baseobject.php';
BaseObject::install_meta('blog', 'allow_anon_recommend', 'vinteger');
示例2: array
# Because it's hard to map tags back to their fields, we store them in a hash
global $customfields_custom_handlers;
$customfields_custom_handlers = array();
$dynamic_functions = '';
# Loop through fields and register the custom template tag handlers
require_once 'class.baseobject.php';
require_once 'class.mt_field.php';
$fld = new Field();
$fields = $fld->Find('1 = 1');
if (!empty($fields)) {
foreach ($fields as $field) {
$tag_name = strtolower($field->field_tag);
$customfields_custom_handlers[$tag_name] = $field;
$col_type = $customfield_types[$field->field_type]['column_def'];
if ($col_type) {
BaseObject::install_meta($field->field_obj_type, 'field.' . $field->field_basename, $col_type);
}
$fn_name = $field->field_id;
$dynamic_functions .= <<<CODE
function customfield_{$fn_name}(\$args, &\$ctx) {
return _hdlr_customfield_value(\$args, \$ctx, '{$tag_name}');
}
CODE;
$ctx->add_tag($tag_name, 'customfield_' . $fn_name);
if (preg_match('/^video|image|file|audio/', $field->field_type)) {
$dynamic_functions .= <<<CODE
function customfield_asset_{$fn_name}(\$args, \$content, &\$ctx, &\$repeat) {
return _hdlr_customfield_asset(\$args, \$content, \$ctx, \$repeat, '{$tag_name}');
}
CODE;
$ctx->add_container_tag($tag_name . $field->type, 'customfield_asset_' . $fn_name);