本文整理汇总了PHP中FLBuilder::render_assets方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilder::render_assets方法的具体用法?PHP FLBuilder::render_assets怎么用?PHP FLBuilder::render_assets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilder
的用法示例。
在下文中一共展示了FLBuilder::render_assets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Renders the layout data to be passed back to the builder.
*
* @since 1.7
* @param string $node_id The ID of a node to try and render instead of the entire layout.
* @param string $old_node_id The ID of a node that has been replaced in the layout.
* @return array
*/
public static function render($node_id = null, $old_node_id = null)
{
// Update the node ID in the post data?
if ($node_id) {
FLBuilderModel::update_post_data('node_id', $node_id);
}
// Render CSS and JS assets.
FLBuilder::render_assets();
// Register scripts needed for shortcodes and widgets.
self::register_scripts();
// Dequeue scripts and styles to only capture those that are needed.
self::dequeue_scripts_and_styles();
// Get the partial refresh data.
$partial_refresh_data = self::get_partial_refresh_data();
// Render the markup.
$html = self::render_html();
// Render scripts and styles.
$scripts_styles = self::render_scripts_and_styles();
// Render the assets.
$assets = self::render_assets();
// Return the response.
return array('partial' => $partial_refresh_data['is_partial_refresh'], 'nodeId' => $partial_refresh_data['node_id'], 'nodeType' => $partial_refresh_data['node_type'], 'oldNodeId' => $old_node_id, 'html' => $html, 'scriptsStyles' => $scripts_styles, 'css' => $assets['css'], 'js' => $assets['js']);
}