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


PHP KObject::mixin方法代碼示例

本文整理匯總了PHP中KObject::mixin方法的典型用法代碼示例。如果您正苦於以下問題:PHP KObject::mixin方法的具體用法?PHP KObject::mixin怎麽用?PHP KObject::mixin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KObject的用法示例。


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

示例1: mixin

 /**
  * Mixin an object
  *
  * When using mixin(), the calling object inherits the methods of the mixed in objects, in a LIFO order.
  *
  * @@param   mixed  $mixin  An object that implements KObjectMixinInterface, KObjectIdentifier object
  *                          or valid identifier string
  * @param    array $config  An optional associative array of configuration options
  * @return  KObject
  */
 public function mixin($mixin, $config = array())
 {
     if ($mixin instanceof KControllerBehaviorAbstract) {
         $actions = $this->getActions();
         foreach ($mixin->getMethods() as $method) {
             if (substr($method, 0, 7) == '_action') {
                 $actions[] = strtolower(substr($method, 7));
             }
         }
         $this->_actions = array_unique($actions);
     }
     return parent::mixin($mixin, $config);
 }
開發者ID:daodaoliang,項目名稱:nooku-framework,代碼行數:23,代碼來源:abstract.php

示例2: mixin

 /**
  * Mixin an object 
  *
  * @param   object  An object that implements KMinxInterface
  * @return  KObject
  */
 public function mixin(KMixinInterface $object, $config = array())
 {
     if ($object instanceof KControllerBehaviorAbstract) {
         foreach ($object->getMethods() as $method) {
             if (substr($method, 0, 7) == '_action') {
                 $this->_actions[] = strtolower(substr($method, 7));
             }
         }
         $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));
     }
     return parent::mixin($object, $config);
 }
開發者ID:stonyyi,項目名稱:anahita,代碼行數:18,代碼來源:abstract.php


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