当前位置: 首页>>代码示例>>PHP>>正文


PHP Bootstrap::singleton方法代码示例

本文整理汇总了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
开发者ID:aodkrisda,项目名称:PHP-Digital-Format-Convert-Epub-Mobi-PDF,代码行数:31,代码来源:index.php

示例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();
开发者ID:realskudd,项目名称:breakfast,代码行数:9,代码来源:index.php

示例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;
开发者ID:realskudd,项目名称:breakfast,代码行数:31,代码来源:layout.tpl.php

示例4: secondsToHms

 public function secondsToHms($seconds)
 {
     return Bootstrap::singleton()->secondsToHms($seconds);
 }
开发者ID:realskudd,项目名称:breakfast,代码行数:4,代码来源:View.class.php

示例5: getActiveUser

 public function getActiveUser()
 {
     return Bootstrap::singleton()->getActiveUser();
 }
开发者ID:realskudd,项目名称:breakfast,代码行数:4,代码来源:Controller.class.php

示例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();
 }
开发者ID:aodkrisda,项目名称:PHP-Digital-Format-Convert-Epub-Mobi-PDF,代码行数:10,代码来源:TransformModel.php


注:本文中的Bootstrap::singleton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。