コード例 #1
0
ファイル: FieldSet.php プロジェクト: manyoubaby123/imshop
 /**
  * @param ActiveField|SetItemInterface $item
  * @return string name
  * @throws \Exception
  */
 protected function getItemName($item)
 {
     if ($item instanceof ActiveField || $item instanceof InputWidget) {
         $name = $item->attribute;
     } elseif ($item instanceof SetItemInterface) {
         $name = $item->getName();
     } else {
         throw new \Exception('Unsupported item type');
     }
     return $name;
 }