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


PHP unknown::toArray方法代码示例

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


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

示例1: __invoke

 /**
  * 
  * @param unknown $entries
  * @param unknown $template
  * @param unknown $media
  */
 public function __invoke($entries, $template, $media)
 {
     $templateKey = static::VIEW_TEMPLATE;
     if (isset($entries['modulFormat'])) {
         $templateKey = $entries['modulFormat'];
     }
     $this->setTemplate($template->plugins->{$templateKey});
     $active = false;
     if (strlen($this->view->paramter['article']) > 1) {
         $active = $this->view->paramter['article'];
     }
     $html = '';
     $elements = $this->elements->toArray();
     foreach ($entries['modulContent'] as $entry) {
         $elements = $this->elements->toArray();
         $elements["grid"]["attr"]['href'] = '/' . $entry['url'] . '/tag/' . $entry['tag_scope'];
         $elements["grid"]["attr"]['title'] = $this->linktitle . ' ' . $entry['tag_name'];
         if ($active === $entry['tag_scope']) {
             $elements["grid"]["attr"]['class'] .= ' disabled';
         }
         $html .= $this->deployRow($elements, $entry['tag_name']);
         $elements = null;
     }
     if (strlen($html) > 1) {
         $wrapper = $this->wrapper->toArray();
         if (isset($wrapper['row'])) {
             $wrapper['row']['content:before'] = '<h3>' . $this->headline . '</h3>';
         }
         $html = $this->deployRow($wrapper, $html);
     }
     return $html;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:38,代码来源:Assigns.php

示例2: renderValue

 /**
  * Render the filter value
  */
 public function renderValue()
 {
     if (!$this->value) {
         return '';
     }
     if ($this->options instanceof \Illuminate\Support\Collection) {
         $this->options = $this->options->toArray();
         $this->value = array_only($this->options, $this->value);
     }
     $value = is_array($this->value) ? implode(', ', $this->value) : $this->value;
     return \Html::filterValue($this->label, $value);
 }
开发者ID:atudz,项目名称:snapneat,代码行数:15,代码来源:FilterCore.php

示例3: __invoke

 /**
  *
  * @param array $content
  * @param unknown $medias
  * @param array $template
  * @return Ambigous <string, multitype:>
  */
 public function __invoke($content, $template)
 {
     if (!empty($template)) {
         $this->setTemplate($template);
         $widget = array();
         if (null !== $this->grid && null !== $this->row) {
             $widget['row'] = $this->row->toArray();
             $widget['grid'] = $this->grid->toArray();
             $content = $this->deployRow($widget, $content);
             if (null !== $this->section) {
                 $widget = array();
                 $widget['grid'] = $this->section->toArray();
                 $content = $this->deployRow($widget, $content);
             }
         } elseif (null !== $this->grid) {
             $widget['grid'] = $this->grid->toArray();
             $content = $this->deployRow($widget, $content);
         }
     }
     $this->unsetProperties();
     return $content;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:29,代码来源:Row.php

示例4: __invoke

 /**
  * Build archive list
  * 
  * @param array $content
  * @param unknown $medias
  * @param array $template
  * @return Ambigous <string, multitype:>
  */
 public function __invoke($entries, $template, $media)
 {
     $templateKey = static::VIEW_TEMPLATE;
     if (isset($entries['modulFormat'])) {
         $templateKey = $entries['modulFormat'];
     }
     $this->setTemplate($template->plugins->{$templateKey});
     $html = '';
     $elements = $this->elements->toArray();
     foreach ($entries['modulContent'] as $year => $url) {
         $elements["grid"]["attr"]['href'] = '/' . $url . '/archive/' . $year;
         $elements["grid"]["attr"]['title'] = $this->linktitle . ' ' . $year;
         $html .= $this->deployRow($elements, $this->view->translate('Year') . ' ' . $year);
     }
     if (strlen($html) > 1) {
         $wrapper = $this->wrapper->toArray();
         if (isset($wrapper['row']) && null != $this->headline) {
             $wrapper['row']['content:before'] = '<h3>' . $this->headline . '</h3>';
         }
         $html = $this->deployRow($wrapper, $html);
     }
     return $html;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:31,代码来源:Annually.php

示例5: months

 /**
  * List mounth
  *
  * @param interger $year            
  * @param array $month            
  * @return string html
  */
 protected function months($year, $month)
 {
     $list = '';
     foreach ($month as $num => $url) {
         $subelements = $this->subelements->toArray();
         $subelements['grid']['attr']['href'] = '/' . $url . '/archive/' . $year . '-' . $num;
         $list .= $this->deployRow($subelements, $this->monthsname[$num]);
     }
     if (strlen($list) > 2) {
         $subwrapper = $this->subwrapper->toArray();
         $subwrapper['grid']['attr']['id'] = $year;
         return $this->deployRow($subwrapper, $list);
     } else {
         return false;
     }
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:23,代码来源:Monthly.php

示例6: __invoke

 /**
  * 
  * @param unknown $entries
  * @param unknown $template
  * @param unknown $media
  */
 public function __invoke($entries, $template, $media)
 {
     $templateKey = static::VIEW_TEMPLATE;
     if (isset($entries['modulFormat'])) {
         $templateKey = $entries['modulFormat'];
     }
     $this->setTemplate($template->plugins->{$templateKey});
     $headline = false;
     $description = false;
     $listelements = '';
     foreach ($entries['modulContent'] as $ident => $fileRow) {
         if (false === $headline && strlen($fileRow['headline'])) {
             $headline = $fileRow['headline'];
         }
         if (false === $description && strlen($fileRow['description'])) {
             $description = $fileRow['description'];
         }
         $files = $this->files->toArray();
         if (strlen($fileRow['attr']['linkname']) > 1) {
             $label = $fileRow['attr']['linkname'];
         } else {
             $label = $fileRow['mediaName'];
         }
         $files['grid']['label'] = 'content';
         $files['grid']['attr']['href'] .= $ident;
         $files['grid']['attr']['title'] = 'Download ' . $label;
         $files['grid']['attr']['data-tooltip'] = 'data-tooltip' . $ident;
         $listelements .= $this->deployRow($this->listelement, $this->deployRow($files, $label . ' (' . $this->view->filesize($fileRow['mediaSizes']) . ')'));
     }
     $html = '';
     if (false !== $headline) {
         $html .= $this->deployRow($this->headline, $headline);
     }
     if (false !== $description) {
         $html .= $this->deployRow($this->description, $description);
     }
     $html .= $this->deployRow($this->list, $listelements);
     $html = $this->deployRow($this->wrapper, $html);
     $this->unsetProperties();
     return $html;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:47,代码来源:Group.php

示例7: toArray

 /**
  * returns existing nodes info as array
  *
  * @return array
  */
 public function toArray()
 {
     return array('code' => $this->getCode(), 'message' => $this->getMessage(), 'nearestRecord' => $this->_nearest_record->toArray());
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:9,代码来源:NoCurrentContract.php

示例8: __invoke

 /**
  *
  * @param unknown $article
  * @param unknown $medias
  * @param string $template
  * @param string $setSize
  * @return string
  */
 public function __invoke($content, $media, $template, $setSize = null, $onlyImg = false)
 {
     $htmlwidgets = '';
     if ('nomediastyle' !== $content->htmlwidgets) {
         $htmlwidgets = $content->htmlwidgets;
         if ($template->contribution->{$htmlwidgets}) {
             $this->setTemplate($template->contribution->{$htmlwidgets});
         } elseif ($template->contribution->_defaultimages) {
             $this->setTemplate($template->contribution->_defaultimages);
         } else {
             $onlyImg = true;
         }
     }
     $size = null;
     $src = $media->mediaLink;
     $unserialize = new HandleSerializeDatabase();
     $mediaMetas = $unserialize->execUnserialize($media->mediaMetas);
     $styleAttr = '';
     $img = '<img src="' . $src . '"';
     if (isset($mediaMetas['alt'])) {
         $img .= ' alt="' . $mediaMetas['alt'] . '"';
     }
     if (false !== ($title = $this->hasValue($mediaMetas, 'title'))) {
         $img .= ' title="' . $title . '"';
     }
     $img .= ' />';
     if (strlen($content->mediaLinkUrl) > 0) {
         $img = '<a href="' . $content->mediaLinkUrl . '">' . $img . '</a>';
     }
     if (true === $onlyImg || 'nomediastyle' === $content->htmlwidgets) {
         $this->unsetProperties();
         return $this->formatElement($img . $content->content, $content);
     }
     $mediarows = $this->media->toArray();
     $mediarows['row']['attr']['class'] .= ' ' . $content->mediaStyle;
     if (false !== ($caption = $this->hasValue($mediaMetas, 'caption'))) {
         $mediarows['row']['content:before'] = $img;
         $images = $this->deployRow($mediarows, $caption);
     } else {
         $images = $this->deployRow(array('grid' => $mediarows['row']), $img);
     }
     switch ($this->direction) {
         case 'left':
             $html = $this->deployRow($this->wrapper, $this->deployRow($this->block, $images) . $this->deployRow($this->content, $this->formatElement($content->content, $content)));
             break;
         case 'right':
             $html = $this->deployRow($this->wrapper, $this->deployRow($this->content, $this->formatElement($content->content, $content)) . $this->deployRow($this->block, $images));
             break;
         default:
             if (1 === $content->mediaPlaceholder) {
                 $html = $this->formatElement(str_replace('{MEDIAPLACE}', $images, $content->content), $content);
             } else {
                 $html = $this->formatElement($images . $content->content, $content);
             }
             break;
     }
     $this->unsetProperties();
     $mediarows = null;
     $images = null;
     return $html;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:69,代码来源:Images.php

示例9: __invoke

 public function __invoke($entries, $template, $media)
 {
     $templateKey = static::VIEW_TEMPLATE;
     if (isset($entries['modulFormat'])) {
         $templateKey = $entries['modulFormat'];
     }
     $this->setTemplate($template->plugins->{$templateKey});
     $imgClass = '';
     if (null !== $this->imgclass) {
         $imgClass = ' ' . $this->imgclass;
     }
     $bulletrow = null;
     if (null !== $this->bulletrow && 'orbitslider6' === $this->gtype && 'no' !== $entries['modulDisplay']) {
         $bulletrow = $this->bulletrow->toArray();
     }
     $list = '';
     $bullets = '';
     $i = 0;
     foreach ($entries['modulContent'] as $media => $entryRow) {
         if (null !== $bulletrow) {
             if (0 === $i) {
                 $bulletrow['row']['attr']['class'] = 'is-active';
             }
             $bulletrow['row']['attr']['data-slide'] = $i;
             $bullets .= $this->deployRow($bulletrow, $entryRow['attr']['alt']);
             if (0 === $i) {
                 unset($bulletrow['row']['attr']['class']);
             }
         }
         $img = '<img' . $imgClass . ' src="' . $media . '" alt="' . $entryRow['attr']['alt'] . '" />';
         if (null === $this->link && 'orbitslider6' !== $this->gtype) {
             if (strlen($entryRow['mediaLinkUrl']) > 1) {
                 $target = '';
                 if ($entryRow['targetLink'] > '0') {
                     $target = ' target="' . $entryRow['targetLink'] . '"';
                 }
                 $img = '<a href="' . $entryRow['mediaLinkUrl'] . '"' . $target . '>' . $img . '</a>';
             }
         }
         $title = $entryRow['attr']['alt'];
         if (isset($entryRow['caption'])) {
             $title = $entryRow['caption'];
             if ($this->caption) {
                 if (strlen($entryRow['mediaLinkUrl']) > 1 && 'lightbox' !== $this->gtype) {
                     $captionStyles = $this->caption->toArray();
                     $caption = $entryRow['caption'];
                     if ('a' === $captionStyles['grid']['element']) {
                         $captionStyles['grid']['attr']['href'] = $entryRow['mediaLinkUrl'];
                         if ($entryRow['targetLink'] > '0') {
                             $captionStyles['grid']['attr']['target'] = $entryRow['targetLink'];
                         }
                     } else {
                         if ($entryRow['targetLink'] > '0') {
                             $target = ' target="' . $entryRow['targetLink'] . '"';
                         }
                         $caption = '<a href="' . $entryRow['mediaLinkUrl'] . '"' . $target . '>' . $caption . '</a>';
                     }
                     $img .= $this->deployRow($captionStyles, $caption);
                 } else {
                     $img .= $this->deployRow($this->caption, $entryRow['caption']);
                 }
             }
         }
         if ($this->link) {
             $link = $this->link->toArray();
             $link['grid']['attr']['title'] = $title;
             $link['grid']['attr']['data-groupname'] = $entryRow['name'];
             $link['grid']['attr']['href'] = $media;
             $list .= $this->deployRow($this->elements, $this->deployRow($link, $img));
         } else {
             if ('orbitslider6' === $this->gtype && 0 === $i) {
                 $elements = $this->elements->toArray();
                 $elements['row']['attr']['class'] = 'is-active ' . $elements['row']['attr']['class'];
                 $list .= $this->deployRow($elements, $img);
             } else {
                 $list .= $this->deployRow($this->elements, $img);
             }
         }
         $i++;
     }
     $html = $this->deployRow($this->wrapper, $list);
     if ('orbitslider6' === $this->gtype) {
         $nav = '';
         if (strlen($bullets) > 1) {
             $nav = $this->deployRow($this->bulletwarpper, $bullets);
         }
         $html = $this->deployRow($this->orbitwrapper, $this->prevbtn . $this->nextbtn . $html . $nav);
     }
     $this->unsetProperties();
     return $html;
 }
开发者ID:jochum-mediaservices,项目名称:contentinum5.5,代码行数:91,代码来源:Blockgrid.php


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