本文整理汇总了PHP中Bootstrap::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::singleton方法的具体用法?PHP Bootstrap::singleton怎么用?PHP Bootstrap::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::singleton方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ucfirst
<?php
if (isset($_GET['function'])) {
require_once 'application/controllers/EpubController.php';
require_once 'application/controllers/MobiController.php';
require_once 'application/controllers/PdfController.php';
require_once 'application/Bootstrap.php';
$function = ucfirst($_GET['function']);
if (isset($_GET['str'])) {
$options = array("html" => "<h1>Hello, World</h1><p><strong>Here is some text, wrapped in 'p' and 'strong' HTML tags</strong></p><p><em>Here is some text, wrapped in 'p' and 'em' HTML tags</em></p>");
}
$controllerName = "{$function}Controller";
$modelName = "{$function}Model";
$actionName = "create{$function}Action";
//use variable variables based on $_GET variable to instantiate class and call method
$bootstrap = Bootstrap::singleton();
$tools = $bootstrap->getTools();
$transform = new TransformModel();
$model = new $modelName($tools);
$controller = new $controllerName($model, $tools, $transform);
$controller->{$actionName}($options);
exit;
}
?>
<html>
<head></head>
<link rel="stylesheet" href="bootstrap.css" />
<body>
<div class="container">
<?php
//a VERY simple page router/despatcher to include the 'default' view if the index.php file is requested
示例2: ob_start
<?php
ob_start();
session_start();
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', true);
ini_set('default_socket_timeout', 120);
include_once 'application/Bootstrap.class.php';
Bootstrap::singleton()->handle();
示例3: plugins
?>
">Home</a></li>
<li><a href="<?php
echo $this->url('Rotation');
?>
">Rotation</a></li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12 col-sm-12 main">
<?php
echo Bootstrap::singleton()->renderMainContent();
?>
</div>
</div>
</div>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="<?php
echo $this->mediaDir;
?>
/templates/default/javascript/jquery-2.1.4.min.js"></script>
<script src="<?php
echo $this->mediaDir;
?>
/templates/default/javascript/timer.jquery.js"></script>
<script src="<?php
echo $this->mediaDir;
示例4: secondsToHms
public function secondsToHms($seconds)
{
return Bootstrap::singleton()->secondsToHms($seconds);
}
示例5: getActiveUser
public function getActiveUser()
{
return Bootstrap::singleton()->getActiveUser();
}
示例6: __construct
/**
* Constructor
* Instantiate bootstrap, get instance of conversion tools
*/
public function __construct()
{
require_once 'application/Bootstrap.php';
$this->bs = Bootstrap::singleton();
$this->dfcTools = $this->bs->getTools();
}