本文整理汇总了PHP中Bootstrap类的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap类的具体用法?PHP Bootstrap怎么用?PHP Bootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bootstrap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootstrap
/**
* Bootstrap the application
*
* Throws Steelcode_Application_Exception if Bootstrap class
* does not extend Steelcode_Application_Bootstrap_Abstract
*
* @param array $options
* @return Stelcode_Application_Config
* @throws Steelcode_Application_Exception
*/
public function bootstrap($options = array())
{
if (!$this->_bootstrap instanceof Steelcode_Application_Bootstrap) {
throw new Steelcode_Application_Exception('Class Bootstrap does not extend Steelcode_Application_Bootstrap_Abstract');
}
return $this->_bootstrap->bootstrap($options);
}
示例2: generate_meta_box
/**
* generate Input type
*/
public function generate_meta_box()
{
global $post_id;
$bootstrap = new Bootstrap();
$bootstrap->load_bootstrap_css();
foreach ($this->meta_boxes["input"] as $input) {
switch ($input["type"]) {
case "text":
$this->render->view("input.text", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "editor":
$this->render->view("input.editor", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "textarea":
$this->render->view("input.textarea", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "email":
$this->render->view("input.email", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "img":
wp_enqueue_media();
$this->render->view("img", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
default:
$this->render->view($input["type"], $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
}
}
}
示例3: bootstrap
public function bootstrap($bootstrap_nodes = NULL)
{
$nodes = $this->settings->kbuckets->toNodeList();
if ($bootstrap_nodes !== NULL) {
$nodes->addNodeList($bootstrap_nodes);
}
$task = new Bootstrap($this->settings, $nodes);
return $task->enqueue();
}
示例4: run
/**
* Run the bootstrap process of the application
* Define constants, settings etc.
* Main point in index.php
*
* @return void
*/
public static function run()
{
if (self::$instance === null) {
self::$instance = new Bootstrap();
}
self::$instance->app = new \Silex\Application();
self::$instance->defineConstants();
self::$instance->includeSettingsAndRoutes();
self::$instance->app->run();
}
示例5: runApplication
/**
* @param string $url
* @param \Phalcon\DI\FactoryDefault $di
*/
private function runApplication($url, DI\FactoryDefault $di = null)
{
require_once dirname(__DIR__) . '/../fixtures/app/Bootstrap.php';
$config = (require dirname(__DIR__) . '/../fixtures/app/config/config.php');
$config = new \Phalcon\Config($config);
$bootstrap = new \Bootstrap($config);
if ($di != null) {
$bootstrap->setDi($di);
}
$bootstrap->setup()->run($url);
}
示例6: UsesBootstrapCssDependingOnSwitches
/**
* @test
* @dataProvider BootstrapCssFilenames
*/
public function UsesBootstrapCssDependingOnSwitches($cdn, $responsive, $fontawesome, $mincss, $expected_filename)
{
$component = new Bootstrap();
$component->_assetsUrl = 'assets';
$component->assetsRegistry = new FakeAssetsRegistry();
$component->enableCdn = $cdn;
$component->responsiveCss = $responsive;
$component->fontAwesomeCss = $fontawesome;
$component->minify = $mincss;
$component->registerBootstrapCss();
$this->assertEquals($expected_filename, $component->assetsRegistry->getLastRegisteredCssFile());
}
示例7: testPostRequestDoesDispatch
/**
* @covers \Heystack\Core\Bootstrap::__construct
* @covers \Heystack\Core\Bootstrap::postRequest
* @covers \Heystack\Core\Bootstrap::doBootstrap
*/
public function testPostRequestDoesDispatch()
{
$session = $this->getSessionMock();
$sessionBackend = $this->getMock('Heystack\\Core\\State\\Backends\\Session');
$eventDispatcher = $this->getMock('Heystack\\Core\\EventDispatcher');
$sessionBackend->expects($this->once())->method('setSession')->with($session);
$eventDispatcher->expects($this->once())->method('dispatch')->with(Events::POST_REQUEST);
$this->container->expects($this->at(0))->method('get')->with(Services::BACKEND_SESSION)->will($this->returnValue($sessionBackend));
$this->container->expects($this->at(1))->method('get')->with(Services::EVENT_DISPATCHER)->will($this->returnValue($eventDispatcher));
$b = new Bootstrap($this->container);
$b->doBootstrap($session);
$b->postRequest($this->getRequestMock(), $this->getMock('SS_HTTPResponse'), $this->getMock('DataModel'));
}
示例8: getSystemLogPath
/**
* Returns the path to system file configurated to log errors. If no paramter
* is passed, tries to load bootstrap from Agana_Util_Bootstrap, else, loads
* from parameter variable.
*
* @param Bootstrap $bootsrap
* @return string System error file path
*/
public static function getSystemLogPath($bootsrap = null)
{
if ($bootsrap) {
$options = $bootsrap->getOption('agana');
} else {
$options = Agana_Util_Bootstrap::getOption('agana');
}
if (isset($options['app']['syserrorfile'])) {
$sysLogFile = $options['app']['syserrorfile'];
} else {
$sysLogFile = APPLICATION_DATA_PATH . '/app.error.log.xml';
}
return $sysLogFile;
}
示例9: setUp
public function setUp()
{
$_SERVER['HTTP_HOST'] = 'vegas.dev';
$_SERVER['REQUEST_URI'] = '/';
$this->di = DI::getDefault();
$modules = (new ModuleLoader())->dump(TESTS_ROOT_DIR . '/fixtures/app', TESTS_ROOT_DIR . '/fixtures/app/config/');
$app = new Application();
$app->registerModules($modules);
require_once TESTS_ROOT_DIR . '/fixtures/app/Bootstrap.php';
$config = (require TESTS_ROOT_DIR . '/fixtures/app/config/config.php');
$config = new \Phalcon\Config($config);
$bootstrap = new \Bootstrap($config);
$bootstrap->setup();
$this->bootstrap = $bootstrap;
}
示例10: init
/**
*### .init()
*
* Initializes the widget.
*/
public function init()
{
parent::init();
$classes = array('table');
if (isset($this->type)) {
if (is_string($this->type)) {
$this->type = explode(' ', $this->type);
}
if (!empty($this->type)) {
$validTypes = array(self::TYPE_STRIPED, self::TYPE_BORDERED, self::TYPE_CONDENSED, self::TYPE_HOVER);
foreach ($this->type as $type) {
if (in_array($type, $validTypes)) {
$classes[] = 'table-' . $type;
}
}
}
}
if (!empty($classes)) {
$classes = implode(' ', $classes);
if (isset($this->itemsCssClass)) {
$this->itemsCssClass .= ' ' . $classes;
} else {
$this->itemsCssClass = $classes;
}
}
$booster = Bootstrap::getBooster();
$popover = $booster->popoverSelector;
$tooltip = $booster->tooltipSelector;
$afterAjaxUpdate = "js:function() {\n\t\t\tjQuery('.popover').remove();\n\t\t\tjQuery('{$popover}').popover();\n\t\t\tjQuery('.tooltip').remove();\n\t\t\tjQuery('{$tooltip}').tooltip();\n\t\t}";
if (!isset($this->afterAjaxUpdate)) {
$this->afterAjaxUpdate = $afterAjaxUpdate;
}
}
示例11: setSkin
public static function setSkin($parser, $skin)
{
/* @todo: in order to work with parsercache this needs to cache the value in wikitext and retreive it
before the skin is initialized */
Bootstrap::$pageSkin = $skin;
return true;
}
示例12: __construct
public function __construct()
{
$config = Config::GetConfig();
$this->_dba = DatabaseAdapter::Create($config['db_adapter']);
$this->_dba->connect($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_flags']);
// Connect to the default database
// @todo Move this decision out of this class
if (class_exists('Bootstrap', false))
{
$this->_dba->selectDatabase(Bootstrap::GetDefaultDatabase()); // @todo Abstraction violation!
}
else
{
$default_db = Config::GetValue('default_db');
if (isset($default_db))
{
$this->_dba->selectDatabase($default_db); // @todo Hack!
}
}
return;
}
示例13: __construct
public function __construct()
{
$b = Bootstrap::getInstance();
$b->init();
$b->includeWordPress();
$this->uploadDir = wp_upload_dir();
}
示例14: forge
/**
* @access public
* @static
* @param array $attrs (default: array())
* @return void
*/
public static function forge(array $attrs = array())
{
is_null(self::$helper) and self::$helper = Bootstrap::forge('html');
// increment instance num, if we need to render more tan than 1 tabs element
self::$inst_num++;
return new self($attrs);
}
示例15: init
public function init()
{
X_VlcShares_Plugins::broker()->gen_beforeInit($this);
$this->bootstrap = $this->getFrontController()->getParam('bootstrap');
$this->options = $this->bootstrap->getResource('configs');
$this->translate = $this->bootstrap->getResource('translation');
X_VlcShares_Plugins::broker()->gen_afterInit($this);
}