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


PHP Widget::get方法代码示例

本文整理汇总了PHP中Widget::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::get方法的具体用法?PHP Widget::get怎么用?PHP Widget::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Widget的用法示例。


在下文中一共展示了Widget::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: head

 /**
  * Render additional <head>.
  *
  * @return  string
  */
 public function head()
 {
     return Widget::get('head');
 }
开发者ID:anqh,项目名称:core,代码行数:9,代码来源:page.php

示例2: foreach

            ?>
<span class="label label-info"><?php 
            echo !empty($db['noOfCollecton']) ? $db['noOfCollecton'] : '';
            ?>
</span></a>
            <?php 
        }
        ?>


        </ul>
        <?php 
    } else {
        foreach ($dbList['databases'] as $db) {
            if ($dbName == $db['name']) {
                $collectionList = Widget::get('CollectonList');
                ?>
                <a href="#accounts-menu" class="nav-header" data-toggle="collapse">
                    <i class="icon-database"></i><?php 
                echo $db['name'];
                ?>
<span class="label label-info"><?php 
                echo $db['noOfCollecton'];
                ?>
</span></a>
                <?php 
                if ($collectionList) {
                    ?>
                    <ul id="accounts-menu" class="nav nav-list collapse in">
                        <?php 
                    foreach ($collectionList as $collection) {
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:31,代码来源:sidebar.php

示例3: saveInto

 /**
  * @param DataObjectInterface $record
  */
 public function saveInto(DataObjectInterface $record)
 {
     $name = $this->name;
     $idName = $name . "ID";
     $widgetarea = $record->getComponent($name);
     $widgetarea->write();
     $record->{$idName} = $widgetarea->ID;
     $widgets = $widgetarea->Items();
     // store the field IDs and delete the missing fields
     // alternatively, we could delete all the fields and re add them
     $missingWidgets = array();
     if ($widgets) {
         foreach ($widgets as $existingWidget) {
             $missingWidgets[$existingWidget->ID] = $existingWidget;
         }
     }
     if (!$this->getForm()) {
         throw new Exception("no form");
     }
     $widgetData = $this->getForm()->getRequest()->requestVar('Widget');
     if ($widgetData && isset($widgetData[$this->getName()])) {
         $widgetAreaData = $widgetData[$this->getName()];
         foreach ($widgetAreaData as $newWidgetID => $newWidgetData) {
             // Sometimes the id is "new-1" or similar, ensure this doesn't get into the query
             if (!is_numeric($newWidgetID)) {
                 $newWidgetID = 0;
             }
             $widget = null;
             if ($newWidgetID) {
                 // \"ParentID\" = '0' is for the new page
                 $widget = Widget::get()->filter('ParentID', array(0, $record->{$name}()->ID))->byID($newWidgetID);
                 // check if we are updating an existing widget
                 if ($widget && isset($missingWidgets[$widget->ID])) {
                     unset($missingWidgets[$widget->ID]);
                 }
             }
             // create a new object
             if (!$widget && !empty($newWidgetData['Type']) && class_exists($newWidgetData['Type']) && is_subclass_of($newWidgetData['Type'], 'Widget')) {
                 $widget = Injector::inst()->create($newWidgetData['Type']);
                 $widget->ID = 0;
                 $widget->ParentID = $record->{$name}()->ID;
             }
             if ($widget) {
                 if ($widget->ParentID == 0) {
                     $widget->ParentID = $record->{$name}()->ID;
                 }
                 $widget->populateFromPostData($newWidgetData);
             }
         }
     }
     // remove the fields not saved
     if ($missingWidgets) {
         foreach ($missingWidgets as $removedWidget) {
             if (isset($removedWidget) && is_numeric($removedWidget->ID)) {
                 $removedWidget->delete();
             }
         }
     }
 }
开发者ID:JayDevlin,项目名称:silverstripe-widgets,代码行数:62,代码来源:WidgetAreaEditor.php

示例4: __

					<div class="info"></div>
				</div>
			</div>
		</div>
		<a class="navi prev" title="<?php 
echo __('Previous');
?>
">&laquo;</a>
		<a class="navi next" title="<?php 
echo __('Next');
?>
">&raquo;</a>
		<a class="action close" title="<?php 
echo __('Close');
?>
">&#10006;</a>
	</div>


<?php 
echo HTML::script_source("\nhead.js(\n\t{ 'jquery': 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' },\n\t{ 'jquery-ui': 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js' },\n\t{ 'jquery-tools': '" . URL::base() . "js/jquery.tools.min.js' },\n\t{ 'jquery-form': '" . URL::base() . "js/jquery.form.js' },\n\t{ 'jquery-overflow': '" . URL::base() . "js/jquery.text-overflow.js' },\n\t{ 'jquery-imgarea': '" . URL::base() . "js/jquery.imgareaselect.js' },\n\t{ 'jquery-scroll': '" . URL::base() . "js/jquery-scrolltofixed-min.js' },\n\t{ 'jquery-markitup': '" . URL::base() . "js/jquery.markitup.pack.js' },\n\t{ 'jquery-bbcode': '" . URL::base() . "js/markitup.bbcode.js' },\n\t{ 'anqh': '" . URL::base() . "js/anqh.js?2' },\n\tfunction() {\n\t\tAnqh.geoNamesURL = '" . Kohana::$config->load('geo.base_url') . "';\n\t\tAnqh.geoNamesUser = '" . Kohana::$config->load('geo.username') . "';\n\t}\n);\n");
?>

<?php 
echo Widget::get('foot');
?>

</body>

</html>
开发者ID:anqh,项目名称:core,代码行数:30,代码来源:template.php

示例5: _head

    /**
     * Render <head>.
     *
     * @return  string
     */
    protected function _head()
    {
        ob_start();
        ?>

<head>
	<meta charset="<?php 
        echo Kohana::$charset;
        ?>
" />
	<meta http-equiv="Content-Type" content="text/html; charset=<?php 
        echo Kohana::$charset;
        ?>
" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

	<title><?php 
        echo $this->title ? HTML::chars($this->title) : Kohana::$config->load('site.site_name');
        ?>
</title>
	<link rel="icon" type="image/png" href="<?php 
        echo $this->base;
        ?>
ui/favicon.png" />

	<?php 
        echo HTML::style('static/css/anqh.css?_=' . filemtime('static/css/anqh.css'));
        ?>
	<?php 
        echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css');
        ?>
	<?php 
        echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.min.css');
        ?>
	<?php 
        echo HTML::style('//cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2-bootstrap.css');
        ?>

	<?php 
        echo HTML::script('//cdnjs.cloudflare.com/ajax/libs/headjs/1.0.3/head.load.js');
        ?>

	<?php 
        echo $this->_open_graph();
        ?>

	<?php 
        echo Widget::get('head');
        ?>

	<?php 
        echo Ads::head();
        ?>

</head>

<?php 
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:anqh,代码行数:64,代码来源:page.php

示例6: array

</a></li>
                    <?php 
}
?>
                    <li id="fat-menu" class="dropdown">
                        <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i><?php 
echo I18n::t('LAN');
?>
                            <i class="icon-caret-down"></i>
                        </a>

                        
                        <ul class="dropdown-menu">
                            <?php 
$languageList = Widget::get('languageList');
foreach ($languageList as $key => $val) {
    ?>
                            <li><a tabindex="-1" href="<?php 
    echo Theme::URL('Index/SetLanguage', array('language' => $key));
    ?>
"><?php 
    echo $val;
    ?>
</a></li>
                            <?php 
}
?>
                        </ul>
                    </li>
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:30,代码来源:header.php

示例7: loadWidgetFromPhp

 protected function loadWidgetFromPhp(Widget $widget, $src)
 {
     $path = $this->kernel->findFileOnPath($src, $this->kernel->getWidgetsPath());
     if ($path) {
         $meta = $this->getFileMeta($path);
         $widgetData = $widget->get();
         include_once $path;
         $extWidget = new $meta['class']($this->kernel, $widgetData);
         $extWidget->bootstrap();
         return $extWidget->get();
     }
     return array();
 }
开发者ID:GusTheSadGeek,项目名称:dashboard,代码行数:13,代码来源:WidgetProvider.php

示例8: loadWidgetFromPhp

 protected function loadWidgetFromPhp(Widget $widget, $src)
 {
     $widgetData = $widget->get();
     $path = $this->kernel->findFileOnPath($src, $this->kernel->getWidgetsPath());
     $widgetClass;
     $phpWidget;
     if (class_exists($src)) {
         $widgetClass = $src;
     } else {
         if ($path) {
             $meta = $this->getFileMeta($path);
             $widgetClass = $meta['class'];
             include_once $path;
         } else {
             return [];
         }
     }
     $phpWidget = $this->bootstrapWidget($widgetClass, $widgetData);
     return $phpWidget->get();
 }
开发者ID:hoborglabs,项目名称:dashboard,代码行数:20,代码来源:WidgetProvider.php


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