本文整理汇总了PHP中FLBuilderModel::add_row方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::add_row方法的具体用法?PHP FLBuilderModel::add_row怎么用?PHP FLBuilderModel::add_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::add_row方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_new_row
/**
* Renders the layout data for a new row.
*
* @since 1.7
* @param string $cols The type of column layout to use.
* @param int $position The position of the new row in the layout.
* @param string $template_id The ID of a row template to render.
* @return array
*/
public static function render_new_row($cols = '1-col', $position = false, $template_id = null)
{
// Add a row template?
if ($template_id) {
// Add the row template.
$row = FLBuilderModel::apply_node_template($template_id, null, $position);
// Return the response.
return self::render($row->node);
} else {
// Add the row.
$row = FLBuilderModel::add_row($cols, $position);
// Render the row.
ob_start();
FLBuilder::render_row($row);
$html = ob_get_clean();
// Return the response.
return array('partial' => true, 'nodeType' => $row->type, 'html' => $html, 'js' => 'FLBuilder._renderLayoutComplete();');
}
}
示例2: render_new_row
/**
* Adds a new row to the current layout and renders it.
*
* @since 1.0
* @param string $cols The type of column layout to use.
* @param int $position The position of the new row in the layout.
* @return void
*/
public static function render_new_row($cols = '1-col', $position = false)
{
$post_data = FLBuilderModel::get_post_data();
$cols = isset($post_data['cols']) ? $post_data['cols'] : $cols;
$position = isset($post_data['position']) ? (int) $post_data['position'] : $position;
$row = FLBuilderModel::add_row($cols, $position);
self::render_row($row);
if (defined('DOING_AJAX')) {
die;
}
}