當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Component類代碼示例

本文整理匯總了PHP中Component的典型用法代碼示例。如果您正苦於以下問題:PHP Component類的具體用法?PHP Component怎麽用?PHP Component使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Component類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onInherit

 public function onInherit(Component &$component)
 {
     if (!PropertyResolver::hasProperty($this->getModelObject(), $component->getId())) {
         return null;
     }
     return new WrappedCompoundModel($this);
 }
開發者ID:picon,項目名稱:picon-framework,代碼行數:7,代碼來源:CompoundPropertyModel.php

示例2: test_generic_component

 function test_generic_component()
 {
     $bodyStyle = new StyleCollection("body", "hey", "Body Style", "Global style settings.");
     $bodyStyle->addSP(new BackgroundColorSP("#FFFCF0"));
     $bodyStyle->addSP(new ColorSP("#2E2B33"));
     $bodyStyle->addSP(new FontSP("Verdana", "10pt"));
     $mainBoxStyle = new StyleCollection("*.mainBoxStyle", "mainBoxStyle", "Main Box Style", "Style for the main box.");
     $mainBoxStyle->addSP(new BackgroundColorSP("#FFF3C2"));
     $mainBoxStyle->addSP(new BorderSP("1px", "solid", "#2E2B33"));
     $mainBoxStyle->addSP(new WidthSP("750px"));
     $mainBoxStyle->addSP(new MarginSP("5px"));
     $mainBoxStyle->addSP(new PaddingSP("5px"));
     $comp1 = new Component(null, BLANK, 3);
     $style = $comp1->addStyle($bodyStyle);
     $this->assertReference($style, $bodyStyle);
     $comp1->addStyle($mainBoxStyle);
     $this->assertReference($comp1->_styleCollections["body"], $bodyStyle);
     $this->assertReference($comp1->_styleCollections["*.mainBoxStyle"], $mainBoxStyle);
     $this->assertIdentical($comp1->getType(), BLANK);
     $this->assertReference($comp1->getStyle("body"), $bodyStyle);
     $comp2 = new Component(null, BLANK, 3, $bodyStyle, $mainBoxStyle);
     $this->assertIdentical($comp2->_styleCollections["body"], $bodyStyle);
     $this->assertIdentical($comp2->_styleCollections["*.mainBoxStyle"], $mainBoxStyle);
     $this->assertIdentical($comp1->getType(), BLANK);
     $this->assertIdentical($comp2->getIndex(), 3);
     $this->assertIdentical($comp1, $comp2);
     $style = $comp1->removeStyle("body");
     $this->assertReference($style, $bodyStyle);
     $this->assertTrue(!isset($comp1->_styleCollections["body"]));
 }
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:30,代碼來源:ComponentsTestCase.class.php

示例3: isComponentInstantiationAuthorised

 public function isComponentInstantiationAuthorised(Component $component)
 {
     if ($component instanceof WebPage && $component->getIdentifier()->of($this->pageAuthIdentifier)) {
         return $this->isAuthorised();
     }
     return true;
 }
開發者ID:picon,項目名稱:picon-framework,代碼行數:7,代碼來源:AbstractPageClassAuthorisationStrategy.php

示例4: attach

 /**
  * Attaches the behavior object to the component.
  * The default implementation will set the [[owner]] property
  * and attach event handlers as declared in [[events]].
  * Make sure you call the parent implementation if you override this method.
  * @param Component $owner the component that this behavior is to be attached to.
  */
 public function attach($owner)
 {
     $this->owner = $owner;
     foreach ($this->events() as $event => $handler) {
         $owner->on($event, is_string($handler) ? [$this, $handler] : $handler);
     }
 }
開發者ID:ajnok,項目名稱:yii2book,代碼行數:14,代碼來源:Behavior.php

示例5: get

 public static function get(Component $component)
 {
     if ($component->getParent() == null && !$component instanceof WebPage) {
         trigger_error('It is not safe to rely on the localizer until the component hierarchy is complete', E_USER_WARNING);
     }
     return new self($component);
 }
開發者ID:picon,項目名稱:picon-framework,代碼行數:7,代碼來源:Localizer.php

示例6: addComponent

 public function addComponent(Component $c)
 {
     if ($this->ultimo) {
         $c->setInput($this->ultimo->getElemento()->getOutput());
     }
     parent::append($c);
 }
開發者ID:DaniloEpic,項目名稱:slast,代碼行數:7,代碼來源:Path.php

示例7: getTimeZone

 /**
  * This method will try to find out the correct timezone for an iCalendar
  * date-time value.
  *
  * You must pass the contents of the TZID parameter, as well as the full
  * calendar.
  *
  * If the lookup fails, this method will return UTC.
  *
  * @param string $tzid
  * @param Sabre\VObject\Component $vcalendar
  * @return DateTimeZone
  */
 public static function getTimeZone($tzid, Component $vcalendar = null)
 {
     // First we will just see if the tzid is a support timezone identifier.
     try {
         return new \DateTimeZone($tzid);
     } catch (\Exception $e) {
     }
     // Next, we check if the tzid is somewhere in our tzid map.
     if (isset(self::$map[$tzid])) {
         return new \DateTimeZone(self::$map[$tzid]);
     }
     if ($vcalendar) {
         // If that didn't work, we will scan VTIMEZONE objects
         foreach ($vcalendar->select('VTIMEZONE') as $vtimezone) {
             if ((string) $vtimezone->TZID === $tzid) {
                 // Some clients add 'X-LIC-LOCATION' with the olson name.
                 if (isset($vtimezone->{'X-LIC-LOCATION'})) {
                     try {
                         return new \DateTimeZone($vtimezone->{'X-LIC-LOCATION'});
                     } catch (\Exception $e) {
                     }
                 }
                 // Microsoft may add a magic number, which we also have an
                 // answer for.
                 if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) {
                     if (isset(self::$microsoftExchangeMap[(int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->value])) {
                         return new \DateTimeZone(self::$microsoftExchangeMap[(int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->value]);
                     }
                 }
             }
         }
     }
     // If we got all the way here, we default to UTC.
     return new \DateTimeZone(date_default_timezone_get());
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:48,代碼來源:TimeZoneUtil.php

示例8: deleteComponent

	public function deleteComponent ($component_id, $reload) {
		$component = new Component($component_id);
		$component->deleteSelf();
		if ($reload) {
			$this->componentList = Search::unitComponents($unit_id);
			$this->makeCount();
		}
	}
開發者ID:sonnaxindustries,項目名稱:sonnax_php,代碼行數:8,代碼來源:clsUnitComponents.php

示例9: getRelatedTagsResult

 /**
  * Answer tag cloud of related tags
  * 
  * @param Component $mainScreen
  * @return void
  * @access public
  * @since 4/8/08
  */
 public function getRelatedTagsResult(Component $mainScreen)
 {
     ob_start();
     print "<h3 style='margin-top: 0px; margin-bottom: 0px;'>" . _("Related Tags:") . "</h3>";
     $tag = $this->getTag();
     print TagAction::getTagCloudDiv($tag->getRelatedTags(TAG_SORT_FREQ), 'view', 100);
     $mainScreen->add(new Block(ob_get_clean(), STANDARD_BLOCK), "100%", null, LEFT, TOP);
 }
開發者ID:adamfranco,項目名稱:segue,代碼行數:16,代碼來源:SegueAllTagAction.abstract.php

示例10: setUp

  function setUp()
  {
    $view = new Component();
    $this->form_component = new MockFormComponent($this);
    $view->addChild($this->form_component, $this->form_id);

    $toolkit =& Limb :: saveToolkit();
    $toolkit->setView($view);
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:9,代碼來源:FormInitCommandTest.class.php

示例11: onComponentTagBody

 public function onComponentTagBody(Component $component, ComponentTag &$tag)
 {
     $panelMarkup = $component->loadAssociatedMarkup();
     $panel = MarkupUtils::findPiconTag('panel', $panelMarkup, $component);
     if ($panel == null) {
         throw new \MarkupNotFoundException(sprintf("Found markup for panel %s however there is no picon:panel tag.", $component->getId(0)));
     }
     $tag->setChildren(array($panel));
 }
開發者ID:picon,項目名稱:picon-framework,代碼行數:9,代碼來源:PanelMarkupSource.php

示例12: renderHead

 public function renderHead(Component $component, HeaderContainer $headerContainer, HeaderResponse $headerResponse)
 {
     $markup = $component->loadAssociatedMarkup();
     $heads = $this->findHead(array($markup));
     foreach ($heads as $index => $head) {
         $id = $component->getId() . '_head_' . $index;
         $headerPart = new HeaderPartContainer($id, $head);
         $headerPart->render();
     }
 }
開發者ID:picon,項目名稱:picon-framework,代碼行數:10,代碼來源:AbstractAssociatedMarkupSource.php

示例13: list_drop

 function list_drop()
 {
     $component = new Component();
     $component->get();
     foreach ($component as $row) {
         $data[''] = '[ Components ]';
         $data[$row->comp_id] = $row->comp_name . ' - ' . $row->comp_type;
     }
     return $data;
 }
開發者ID:anggadjava,項目名稱:payroll,代碼行數:10,代碼來源:component.php

示例14: getTimeZone

 /**
  * This method will try to find out the correct timezone for an iCalendar
  * date-time value.
  *
  * You must pass the contents of the TZID parameter, as well as the full
  * calendar.
  *
  * If the lookup fails, this method will return the default PHP timezone
  * (as configured using date_default_timezone_set, or the date.timezone ini
  * setting).
  *
  * Alternatively, if $failIfUncertain is set to true, it will throw an
  * exception if we cannot accurately determine the timezone.
  *
  * @param string $tzid
  * @param SabreForRainLoop\VObject\Component $vcalendar
  * @return DateTimeZone
  */
 public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false)
 {
     // First we will just see if the tzid is a support timezone identifier.
     try {
         return new \DateTimeZone($tzid);
     } catch (\Exception $e) {
     }
     // Next, we check if the tzid is somewhere in our tzid map.
     if (isset(self::$map[$tzid])) {
         return new \DateTimeZone(self::$map[$tzid]);
     }
     // Maybe the author was hyper-lazy and just included an offset. We
     // support it, but we aren't happy about it.
     if (preg_match('/^GMT(\\+|-)([0-9]{4})$/', $tzid, $matches)) {
         return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2], 0, 2), '0'));
     }
     if ($vcalendar) {
         // If that didn't work, we will scan VTIMEZONE objects
         foreach ($vcalendar->select('VTIMEZONE') as $vtimezone) {
             if ((string) $vtimezone->TZID === $tzid) {
                 // Some clients add 'X-LIC-LOCATION' with the olson name.
                 if (isset($vtimezone->{'X-LIC-LOCATION'})) {
                     $lic = (string) $vtimezone->{'X-LIC-LOCATION'};
                     // Libical generators may specify strings like
                     // "SystemV/EST5EDT". For those we must remove the
                     // SystemV part.
                     if (substr($lic, 0, 8) === 'SystemV/') {
                         $lic = substr($lic, 8);
                     }
                     try {
                         return new \DateTimeZone($lic);
                     } catch (\Exception $e) {
                     }
                 }
                 // Microsoft may add a magic number, which we also have an
                 // answer for.
                 if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) {
                     $cdoId = (int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->getValue();
                     // 2 can mean both Europe/Lisbon and Europe/Sarajevo.
                     if ($cdoId === 2 && strpos((string) $vtimezone->TZID, 'Sarajevo') !== false) {
                         return new \DateTimeZone('Europe/Sarajevo');
                     }
                     if (isset(self::$microsoftExchangeMap[$cdoId])) {
                         return new \DateTimeZone(self::$microsoftExchangeMap[$cdoId]);
                     }
                 }
             }
         }
     }
     if ($failIfUncertain) {
         throw new \InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: ' . $tzid);
     }
     // If we got all the way here, we default to UTC.
     return new \DateTimeZone(date_default_timezone_get());
 }
開發者ID:helsaba,項目名稱:rainloop-webmail,代碼行數:73,代碼來源:TimeZoneUtil.php

示例15: renderComponent

 private function renderComponent(Component $viewComp)
 {
     if (isset($_GET["ajax"])) {
         return StringUtil::getJson("body", $viewComp->renderBodyChildren());
     }
     $view = $viewComp->render();
     if (isset($_GET["file"])) {
         $view .= $this->jsRewriteParent();
     }
     return $view;
 }
開發者ID:aeberh,項目名稱:php-movico,代碼行數:11,代碼來源:ViewRenderer.php


注:本文中的Component類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。