Skip to content

Instantly share code, notes, and snippets.

@sorenmalling
Created April 23, 2013 12:00
Show Gist options
  • Save sorenmalling/5443008 to your computer and use it in GitHub Desktop.
Save sorenmalling/5443008 to your computer and use it in GitHub Desktop.
renderObj = COA
renderObj {
wrap = <ul>|</ul>
1 = TEXT
1 {
wrap = <li>|</li>
typolink {
parameter.field = link
}
field = title
}
}
Using
$this->cObj->cObjGetSingle($this->conf[$endpoint . '.']['renderObj'], $this->conf[$endpoint . '.']['renderObj.']);
outputs
<ul>
<li>
<a href="..." >Element 1</a>
</li>
</ul>
<ul>
<li>
<a href="..." >Element 2</a>
</li>
</ul>
would like
<ul>
<li>
<a href="..." >Element 1</a>
</li>
<li>
<a href="..." >Element 2</a>
</li>
</ul>
@peterkraume
Copy link

I'd do it this way:
$content .= $this->cObj->wrap($this->cObj->cObjGetSingle($this->conf[$endpoint . '.']['renderObj'], $this->conf[$endpoint . '.']['renderObj.']), '

    |
');

@smichaelsen
Copy link

Something like:

[endpoint name] {
  stdWrap.wrap = <ul>|<ul>
  renderObj {
    [like above]
  }
}
$response = json_decode($disqusService->request());
$listcontent = '';
foreach ($response->response as $response) {
   $this->cObj->data = get_object_vars($response);
   $listcontent .= $this->cObj->cObjGetSingle($this->conf[$endpoint . '.']['renderObj'], $this->conf[$endpoint . '.']['renderObj.']);
}
$listcontent = $this->cObj->stdWrap($listcontent, $this->conf[$endpoint . '.']['stdWrap.']);
$content .= $listcontent;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment