function loadAllWidgets($widgetList, $params = array()) { if (!is_array($widgetList)) { $widgetList = explode(",", $widgetList); } elseif (strlen($widgetList) <= 0) { return; } foreach ($widgetList as $a) { loadWidget($a, $params); } }
This is Blog Index View <form> <input type="text"> </form> <?php echo $title; echo $alam; loadWidget('Widgets.Hello', array('imageDir' => '/images'));
?> /css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </HEAd> </head> </head> <body> <div id="sidebar"> <?php loadWidget('Widgets.Hello'); ?> </div> <?php echo $this->content; ?> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="<?php echo $this->templateBaseURL; ?> /js/bootstrap.min.js"></script> </body>
<style> #wrapper { padding-left: 0px; } #wrapper #footer { left:0px; } </style> <div class="container-fluid"> <div class='articleContent'> <?php //loadModule("test");exit(); $page = explode("/", $_REQUEST['page']); if (isset($page[count($page) - 1]) && strlen($page[count($page) - 1]) <= 0) { unset($page[count($page) - 1]); } if (count($page) <= 1) { $page[1] = "about"; } loadModule("content"); $title = printContent($page[1]); if ($title == null) { include APPROOT . APPS_PAGES_FOLDER . "error.php"; } else { if ($page[1] == "about") { loadWidget("socialbar"); } } ?> </div> </div>
/** * Smarty plugin * * @package Smarty * @subpackage PluginsFunction * @author Bismay Kumar Mohaptra */ function smarty_function_widget($params, Smarty_Internal_Template $template) { $GLOBALS['PAGETMPL'] = $template->smarty; return loadWidget($params['src']); }
/** * Smarty plugin * * @package Smarty * @subpackage PluginsFunction * @author Bismay Kumar Mohaptra */ function smarty_function_widget($params) { return loadWidget($params['src']); }