本文整理汇总了PHP中Widget::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::render方法的具体用法?PHP Widget::render怎么用?PHP Widget::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::render方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($settings = array(), $force = false)
{
$out = parent::render($settings, $force);
if ($this->show_existing) {
$out .= sprintf($this->show_existing_template, $this->value());
}
return $out;
}
示例2: render
public function render($view, $data = array(), $return = false)
{
if (isset($this->blockModel) && isset($this->model)) {
return parent::render($this->widgetModel->pk.'/'.$view, $data, $return);
} else {
return parent::render($view, $data, $return);
}
}
示例3: page
function page()
{
global $db, $user, $session, $sites;
/*
* Lets send a test message to the logged in user
$message = new Message();
$message->to(1);
$message->from(0); //0 will be "system";
$message->setSubject('This is a second test message');
$message->setBody("This would be an actual message had this not been a test.");
$message->send();
*/
print "Set site is " . $session->current_site;
?>
<h3>Dashboard</h3>
<section id="widget-grid" class="">
<!-- row -->
<div class="row">
<article class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<?php
$test = new Widget();
$test->setTitle('My first widget');
$action2 = array('label' => 'Test', 'url' => '/pages/user/users.php', 'class' => 'danger');
$test->setActions($action2);
$actions = array('label' => 'Users', 'subitems' => array(array('label' => 'Users2', 'url' => '/pages/user/users.php'), array('label' => 'Users3', 'url' => '/pages/user/users.php')));
$test->setActions($actions);
$test->render();
$test2 = new Widget();
$test2->setTitle('My second widget');
$headers = array('First Name', 'Last Name');
$data = $db->select('firstname,lastname')->from('users')->limit(10)->fetch();
$test2->addTable($headers, $data);
$test2->render();
print "Cookies<br>";
if (isset($_COOKIE)) {
foreach ($_COOKIE as $name => $value) {
$name = htmlspecialchars($name);
$value = htmlspecialchars($value);
echo "{$name} : {$value} <br />\n";
}
}
?>
</article>
<article class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<?php
$test3 = new Widget();
$test3->setTitle('My third widget');
$test3->addContent("<p>Sites allowed:</p>" . $user->sites('list'));
$test3->render();
?>
</article>
</div>
</section>
<?php
}
示例4: load
/**
* Factory method
*
* // Request widget by path: /blog/widget/recent/index?sort=title&limit=10
* echo Widget::load('blog', 'recent', null, ['sort' => 'title', 'limit' => 10]);
*
* @param string $module module name without prefix cms_
* @param string $controller controller name
* @param string $action action name (default index)
* @param array $query array of query parameters
* @return Response
*/
public static function load($module, $controller, $action = null, array $query = null)
{
$widget = new Widget($module, $controller, $action, $query);
return $widget->render();
}
示例5: load
public static function load($widget_name, array $params = NULL, $route_name = NULL)
{
$widget = new Widget($widget_name, $params, $route_name);
return $widget->render();
}