本文整理汇总了PHP中FLBuilder::render_layout方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilder::render_layout方法的具体用法?PHP FLBuilder::render_layout怎么用?PHP FLBuilder::render_layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilder
的用法示例。
在下文中一共展示了FLBuilder::render_layout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_settings
/**
* Save the settings for a node.
*
* @since 1.0
* @param string $node_id The node ID.
* @param object $settings The settings to save.
* @return void
*/
public static function save_settings($node_id = null, $settings = null)
{
$post_data = self::get_post_data();
$node_id = isset($post_data['node_id']) ? $post_data['node_id'] : $node_id;
$settings = isset($post_data['settings']) ? $post_data['settings'] : $settings;
$node = self::get_node($node_id);
$new_settings = (object) array_merge((array) $node->settings, (array) $settings);
$template_post_id = self::is_node_global($node);
// Process the settings.
$new_settings = self::process_node_settings($node, $new_settings);
// Save the settings to the node.
$data = self::get_layout_data();
$data[$node_id]->settings = $new_settings;
// Update the layout data.
self::update_layout_data($data);
// Save settings for a global node template?
if ($template_post_id && !self::is_post_node_template()) {
// Get the template data.
$template_data = self::get_layout_data('published', $template_post_id);
// Update the template node settings.
$template_data[$node->template_node_id]->settings = $new_settings;
// Save the template data.
self::update_layout_data($template_data, 'published', $template_post_id);
self::update_layout_data($template_data, 'draft', $template_post_id);
// Delete the template asset cache.
self::delete_all_asset_cache($template_post_id);
self::delete_node_template_asset_cache($template_post_id);
}
// Return the new layout.
if (defined('DOING_AJAX')) {
FLBuilder::render_layout();
}
}
示例2: save_settings
/**
* Save the settings for a node.
*
* @since 1.0
* @param string $node_id The node ID.
* @param object $settings The settings to save.
* @return void
*/
public static function save_settings($node_id = null, $settings = null)
{
$post_data = self::get_post_data();
$node_id = isset($post_data['node_id']) ? $post_data['node_id'] : $node_id;
$settings = isset($post_data['settings']) ? $post_data['settings'] : $settings;
$node = self::get_node($node_id);
$new_settings = (object) array_merge((array) $node->settings, (array) $settings);
// Process the settings.
$new_settings = self::process_node_settings($node, $new_settings);
// Save the settings to the node.
$data = self::get_layout_data();
$data[$node_id]->settings = $new_settings;
// Update the layout data.
self::update_layout_data($data);
// Return the new layout.
if (defined('DOING_AJAX')) {
FLBuilder::render_css();
FLBuilder::render_js();
FLBuilder::render_layout();
}
}