本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}