• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Label类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Label的典型用法代码示例。如果您正苦于以下问题:PHP Label类的具体用法?PHP Label怎么用?PHP Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: draw

 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 1, $this->width, 40);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", $this->headline, "headbox", 1);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new FormImage($c["docroot"] . "modules/stats/widgets/statsimage.php?sid={$sid}&diagram=" . $this->diagramType . "&width=" . $this->width . "&height=" . $this->height . "&spid=" . $this->spid, $this->width, $this->height, 1);
     $widget->draw();
     // Draw Legend...
     echo "</tr><tr>\n";
     $widget = new Cell("clc", "", 1, $this->width, 10);
     $widget->draw();
     $colors[0] = __RED;
     $colors[1] = __BLUE;
     $colors[2] = __YELLOW;
     $colors[3] = __GREEN;
     for ($i = 0; $i < count($this->legend); $i++) {
         echo "</tr><tr><td>";
         echo '<table width="100%" border="0" cellpadding="2" cellspacing="0"><tr>';
         echo '<td width="10">' . ($i + 1) . '.</td>';
         echo '<td width="11">';
         echo '<table width="11" height="11" border="0" cellspacing="0" cellpadding="0"><tr><td style="background-color:' . $colors[$i] . ';">' . drawSpacer(11, 11) . '</td></tr></table>';
         echo '</td>';
         echo '<td>' . $this->legend[$i] . '</td>';
         echo '</tr></table></td>';
     }
     echo "</tr></table></td>";
     return $this->cells;
 }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:36,代码来源:statsdiagram.php


示例2: renderLabel

 public function renderLabel($name, $attributes = array())
 {
     if ($widget = $this->widgets->get($name)) {
         $label = new Label($widget->label);
         return $label->render($attributes);
     }
 }
开发者ID:corneltek,项目名称:formkit,代码行数:7,代码来源:BaseLayout.php


示例3: testRender

 /**
  * @covers Xoops\Form\Label::render
  */
 public function testRender()
 {
     $value = $this->object->render();
     $this->assertTrue(is_string($value));
     $this->assertTrue(false !== strpos($value, '<span'));
     $this->assertTrue(false !== strpos($value, 'id="name"'));
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:10,代码来源:LabelTest.php


示例4: renderFormFieldContent

 private function renderFormFieldContent($renderApi, $unit)
 {
     $this->formSubmit = new \FormSubmit();
     $fieldId = 'field' . $unit->getId();
     $properties = $unit->getFormValues();
     $labelText = $properties["fieldLabel"];
     $listType = $properties["listType"];
     //select, checkbox, radio
     $postRequest = $this->getPostValue($unit);
     $choiceBox = new \ChoiceBox();
     if ($listType === \ListType::RADIO || $listType === \ListType::CHECKBOX) {
         $required = $renderApi->getFormValue($unit, 'enableRequired');
         $formField = $choiceBox->getRadioCheckbox($renderApi, $unit, $fieldId, $postRequest, $required);
     } elseif ($listType === \ListType::DROP_DOWN) {
         $formField = $choiceBox->getSelectField($renderApi, $unit, $fieldId, $postRequest);
     }
     $label = new \Label();
     $labelProperties = $label->getElementProperties();
     $labelProperties->addAttribute("for", $fieldId);
     $label->add(new \Span($labelText));
     if ($formField) {
         $elementProperties = $formField->getElementProperties();
         $wrapper = new \Container();
         $wrapper->add($label);
         $wrapper->add($formField);
         echo $wrapper->renderElement();
     }
     $renderApi->renderChildren($unit);
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:29,代码来源:rz_form_field_select.php


示例5: label

function label($text, $font)
{
    $label = new Label($text, $font, NULL, 0);
    $label->setBackgroundColor(new Color(255, 255, 255, 25));
    $label->border->show();
    $label->setPadding(1, 0, 0, 0);
    return $label;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:8,代码来源:LinePlot-10.test.php


示例6: draw

		/**
		 * Write HTML for the WUI-Object.
		 *
		 */
		function draw() {
			$dr3 = new Label("lbl", $this->text, "headbox", $this->columns);
			echo "<tr>";
			$dr3->draw();
			echo "</tr>";

			return $this->columns;
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:12,代码来源:subtitle.php


示例7: actionManage

 public function actionManage()
 {
     $model = new Label('search');
     $model->unsetAttributes();
     if (isset($_GET['Label'])) {
         $model->attributes = $_GET['Label'];
     }
     $this->render('manage', array('model' => $model));
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:9,代码来源:LabelAdminController.php


示例8: create

 public function create()
 {
     $L = new Label();
     if (!$L->find($this->label)) {
         $L->label = $this->label;
         $L->create();
     }
     return parent::create();
 }
开发者ID:frdl,项目名称:webfan,代码行数:9,代码来源:Edge.php


示例9: createFromXML

 /**
  * Convert the raw XML into an object
  *
  * @param \SimpleXMLElement $xml
  * @return Label
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $label = new Label();
     $attributes = $xml->attributes();
     if (isset($attributes['cdbid'])) {
         $label->setCdbid($attributes['cdbid']);
     }
     $label->setValue((string) $xml);
     return $label;
 }
开发者ID:tijsverkoyen,项目名称:uitdatabank,代码行数:16,代码来源:Label.php


示例10: AddMeasurement

 public function AddMeasurement($measurement)
 {
     $measurement->TestId = $this->Id;
     $this->Measurements[] = $measurement;
     if ($measurement->Name == 'Label') {
         $label = new Label();
         $label->SetText($measurement->Value);
         $this->AddLabel($label);
     }
 }
开发者ID:kitware,项目名称:cdash,代码行数:10,代码来源:test.php


示例11: updateset

function updateset($lid)
{
    $clang = Yii::app()->lang;
    // Get added and deleted languagesid arrays
    if ($_POST['languageids']) {
        $postlanguageids = sanitize_languagecodeS($_POST['languageids']);
    }
    if ($_POST['label_name']) {
        $postlabel_name = sanitize_labelname($_POST['label_name']);
    }
    $newlanidarray = explode(" ", trim($postlanguageids));
    $oldlangidsarray = array();
    $labelset = Labelsets::model()->findByAttributes(array('lid' => $lid));
    $oldlangidsarray = explode(' ', $labelset->languages);
    $addlangidsarray = array_diff($newlanidarray, $oldlangidsarray);
    $dellangidsarray = array_diff($oldlangidsarray, $newlanidarray);
    // If new languages are added, create labels' codes and sortorder for the new languages
    $result = Label::model()->findAllByAttributes(array('lid' => $lid), array('order' => 'code, sortorder, assessment_value'));
    if ($result) {
        foreach ($result as $row) {
            $oldcodesarray[$row['code']] = array('sortorder' => $row['sortorder'], 'assessment_value' => $row['assessment_value']);
        }
    }
    if (isset($oldcodesarray) && count($oldcodesarray) > 0) {
        foreach ($addlangidsarray as $addedlangid) {
            foreach ($oldcodesarray as $oldcode => $olddata) {
                $sqlvalues[] = array('lid' => $lid, 'code' => $oldcode, 'sortorder' => $olddata['sortorder'], 'language' => $addedlangid, 'assessment_value' => $olddata['assessment_value']);
            }
        }
    }
    if (isset($sqlvalues)) {
        foreach ($sqlvalues as $sqlvalue) {
            $label = new Label();
            foreach ($sqlvalue as $name => $value) {
                $label->setAttribute($name, $value);
            }
            $label->save();
        }
    }
    // If languages are removed, delete labels for these languages
    $criteria = new CDbCriteria();
    $criteria->addColumnCondition(array('lid' => $lid));
    $langcriteria = new CDbCriteria();
    foreach ($dellangidsarray as $dellangid) {
        $langcriteria->addColumnCondition(array('language' => $dellangid), 'OR');
    }
    $criteria->mergeWith($langcriteria);
    if (!empty($dellangidsarray)) {
        $result = Label::model()->deleteAll($criteria);
    }
    // Update the label set itself
    $labelset->label_name = $postlabel_name;
    $labelset->languages = $postlanguageids;
    $labelset->save();
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:55,代码来源:label_helper.php


示例12: onClickUnblock

 public function onClickUnblock($sender)
 {
     $this->captcha_error_obj->emptyObject();
     if ($this->captcha->check()) {
         WspBannedVisitors::resetBannedIP($this->getRemoteIP());
         $this->refreshPage();
     } else {
         $error = new Label(__(ERROR_CAPTCHA));
         $error->setColor("red");
         $this->captcha_error_obj->add($error);
     }
 }
开发者ID:kxopa,项目名称:WebSite-PHP,代码行数:12,代码来源:error-user-ban.php


示例13: updateActual

 public function updateActual($aData)
 {
     if (isset($aData['id'])) {
         $this->id = $aData['id'];
         $this->edited = new Doctrine_Expression('NOW()');
     } else {
         $this->created = new Doctrine_Expression('NOW()');
         $this->edited = new Doctrine_Expression('NOW()');
     }
     $aTags = Tag::checkTags(Tag::makeTags($aData['tags']));
     $this->title = $aData['title'];
     $this->shortcontent = trim(stripslashes($aData['shortcontent']));
     $this->fullcontent = trim(stripslashes($aData['fullcontent']));
     $this->tags = $aData['tags'];
     $this->active = $aData['active'];
     $this->link = Webbers_Normalize::Link($aData['title']);
     $this->AktualsTags->delete();
     $this->AktualsLabels->delete();
     $this->save();
     if (sizeof($aTags) > 0) {
         foreach ($aTags as $tag) {
             $aktualTags = new AktualsTag();
             $aktualTags->Aktuals_id = $this->id;
             $aktualTags->Tags_id = $tag->id;
             $aktualTags->save();
         }
     }
     $labels = array();
     if (isset($aData['newlabel']) and $aData['newlabel'] != '') {
         $newLabel = Webbers_Normalize::Name($aData['newlabel']);
         $label = Label::getLabel($newLabel);
         if ($label != false) {
             $labelID = $label->id;
         } else {
             $label = new Label();
             $label->Gname = $newLabel;
             $label->save();
             $labelID = $label->getIncremented();
         }
         $labels = array($labelID);
     }
     if (isset($aData['labels']) and sizeof($aData['labels']) > 0) {
         $labels = array_unique(array_merge($aData['labels'], $labels));
         foreach ($labels as $lab) {
             $al = new AktualsLabel();
             $al->Labels_id = $lab;
             $al->Aktuals_id = $this->id;
             $al->save();
         }
     }
     return $this->id;
 }
开发者ID:jager,项目名称:cms,代码行数:52,代码来源:Aktual.php


示例14: draw

 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '"><table width="600" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 2, $this->width, 20);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", '<br><h3>' . $this->headline . '</h3>', '', 2);
     $widget->draw();
     echo "</tr>\n";
     echo $this->container;
     echo "</tr></table></td>";
     return $this->cells;
 }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:17,代码来源:statsclickpath.php


示例15: draw

 /**
  * Draw HTML output
  */
 function draw()
 {
     global $c, $sid;
     echo '<td colspan="' . $this->cells . '" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
     $widget = new Cell("clc", "", 4, $this->width, 20);
     $widget->draw();
     echo "</tr><tr>\n";
     $widget = new Label("lbl", $this->headline, "stats_headline", 4);
     $widget->draw();
     echo "</tr>\n";
     echo $this->container;
     echo "</tr></table></td>";
     return $this->cells;
 }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:17,代码来源:topitems.php


示例16: renderFormFieldContent

 private function renderFormFieldContent($renderApi, $unit)
 {
     $this->formSubmit = new \FormSubmit();
     $fieldId = 'field' . $unit->getId();
     $properties = $unit->getFormValues();
     $labelText = $properties["fieldLabel"];
     $fieldType = $properties["textType"];
     //input,list,textarea
     $postRequest = $this->getPostValue($unit);
     if ($properties['type'] === \InputType::STRING && $fieldType !== FieldType::TEXTAREA || $properties['type'] === \InputType::EMAIL || $properties['type'] === \InputType::NUMERIC) {
         $formField = new \TextField();
         $elementProperties = $formField->getElementProperties();
         $elementProperties->setId($fieldId);
         $elementProperties->addAttribute("name", $fieldId);
         $elementProperties->addAttribute('value', $postRequest);
         if (isset($properties['type'])) {
             if ($properties['type'] === \InputType::EMAIL) {
                 $elementProperties->addAttribute("type", \InputType::EMAIL);
             }
             if ($properties['type'] === \InputType::NUMERIC) {
                 $elementProperties->addAttribute("type", \InputType::NUMERIC);
             }
         }
     } elseif ($fieldType === FieldType::TEXTAREA) {
         $formField = new \TextareaField();
         $elementProperties = $formField->getElementProperties();
         $elementProperties->setId($fieldId);
         $elementProperties->addAttribute("name", $fieldId);
         $formField->setContent($postRequest);
     }
     $label = new \Label();
     $labelProperties = $label->getElementProperties();
     $labelProperties->addAttribute("for", $fieldId);
     $label->add(new \Span($labelText));
     if ($formField) {
         $wrapper = new \Container();
         $wrapper->add($label);
         $wrapper->add($formField);
         $elementProperties = $formField->getElementProperties();
         if ($this->formSubmit->isValid($renderApi, $unit) && !$this->isValidValue($unit, $postRequest)) {
             $elementProperties->addClass('vf__error');
             $wrapper->add($this->getErrorMessage($unit, $postRequest));
         }
         $this->setRequiredField($renderApi, $unit, $elementProperties);
         $this->setPlaceholderText($renderApi, $unit, $elementProperties);
         echo $wrapper->renderElement();
     }
     $renderApi->renderChildren($unit);
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:49,代码来源:rz_form_field_text.php


示例17: testRemoveLabels_DelegatesToClient

 public function testRemoveLabels_DelegatesToClient()
 {
     $expected = $this->node;
     $expected->setId(123);
     $matched = false;
     $label = new Label($this->client, 'FOOBAR');
     $this->client->expects($this->once())->method('removeLabels')->will($this->returnCallback(function (Node $actual, $labels) use($expected, $label, &$matched) {
         $matched = $expected->getId() == $actual->getId();
         $matched = $matched && $label->getName() == $labels[0]->getName();
         return array($label);
     }));
     $labels = $this->node->removeLabels(array($label));
     $this->assertEquals(1, count($labels));
     $this->assertSame($label, $labels[0]);
 }
开发者ID:MobilityMaster,项目名称:neo4jphp,代码行数:15,代码来源:NodeTest.php


示例18: render

 public function render(array $item)
 {
     // When no items are set, we act as if this is a normal label.
     // @todo Decide if we should throw an exception instead?
     if (empty($item['child_items'])) {
         return parent::render($item);
     }
     $options = $this->getOptions($item);
     $label = $this->getLabel($options);
     $title = $this->getTitle($options, $label);
     $id = uniqid();
     $boxId = 'dropdown-box-' . $id . '-dropdown';
     $anchorId = 'menu-option-' . $id;
     $anchorAttr = [];
     $anchorAttr['href'] = '';
     $anchorAttr['id'] = $anchorId;
     $anchorAttr['class'] = 'zui-button-dropdown';
     $anchorAttr['aria-haspopup'] = 'true';
     $anchorAttr['aria-controls'] = $boxId;
     $anchorAttr['aria-expanded'] = 'false';
     $anchorAttr['title'] = $title;
     $result = '<li role="presentation">';
     $result .= sprintf('<a %s>%s</a>', $this->createAttribs($anchorAttr), $label);
     $result .= $this->renderBox($anchorId, $boxId, $item);
     return $result . '</li>';
 }
开发者ID:zource,项目名称:zource,代码行数:26,代码来源:Dropdown.php


示例19: main

 public function main($build_type, $label)
 {
     $label = Label::where('label_name', '=', $label)->firstOrFail();
     $versions = $label->versions();
     $this->setTitle("Versions with label - {$label->label_name}");
     $this->layout->versions = $versions->get();
 }
开发者ID:NeZanyat,项目名称:laravel-example,代码行数:7,代码来源:VersionController.php


示例20: drawLabels

	protected function drawLabels($drawer) {
		
		if($this->labelNumber !== NULL) {
			list($min, $max) = $this->range;
			$number = $this->labelNumber - 1;
			if($number < 1) {
				return;
			}
			$function = $this->rangeCallback['toValue'];
			$labels = array();
			for($i = 0; $i <= $number; $i++) {
				$labels[] = $function($i / $number, $min, $max);
			}
			$this->label->set($labels);
		}
		
		$labels = $this->label->count();
		
		for($i = 0; $i < $labels; $i++) {
		
			$p = $this->getPointFromValue($this->label->get($i));
			$this->label->draw($drawer, $p, $i);
		
		}
		
	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:26,代码来源:Axis.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP LabelUtil类代码示例发布时间:2022-05-23
下一篇:
PHP LabConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap