19 $this->content=array();
23 if(JArray::isAssociative($items)){
24 foreach ($items as $k=>$v){
28 foreach ($items as $item){
36 $this->content=$items;
54 if(JString::isNull($item->getIdentifier())){
55 $item->setIdentifier($classname.
"-".$this->identifier.
"-".$index);
73 \array_splice( $this->content, $position, 0, array($itemO));
83 if (is_int($index)&& isset($this->content[$index]))
84 return $this->content[$index];
92 $this->content[$index]=$value;
97 return array_splice($this->content, $index, 1);
101 return \sizeof($this->content);
108 return $this->
addItem($function($object));
112 foreach ($this->content as $item){
133 return !($value instanceof
BaseHtml);
137 foreach ($this->content as $item){
146 $c=$this->content[$i++];
148 $c->setProperty($k,$v);
162 if(\is_array($values)===
false){
163 $values=\array_fill(0, $this->
count(),$values);
165 foreach ($values as $i=>$value){
166 if(isset($this->content[$i])){
167 $this->content[$i]->setProperty($property,$value);
183 if(\is_array($values)===
false){
184 $values=\array_fill(0, $this->
count(),$values);
186 foreach ($values as $i=>$value){
187 if(isset($this->content[$i])){
188 $this->content[$i++]->addToProperty($property,$value);
200 foreach ($this->content as $item){
203 return parent::compile($js,$view);
215 public function asLinks($hrefs=[],$target=NUll) {
216 foreach ( $this->content as $index=>$item ) {
219 if(isset($hrefs[$index]))
220 $href=$hrefs[$index];
221 $item->asLink($href,$target);
233 public function splice($offset,$length=
null){
234 $this->content=array_slice($this->content, $offset,$length);
BaseHtml for HTML components.
getElementById($identifier, $elements)
Base class for Html collections.
addPropertyValues($property, $values)
Adds the values of a property for each item in the collection.
createItem($value)
The item factory.
splice($offset, $length=null)
Remove a portion of the items array and replace it with something else.
asLinks($hrefs=[], $target=NUll)
__construct($identifier, $tagName="div")
addItem($item)
adds and returns an item
getItem($index)
Return the item at index.
compile(JsUtils $js=NULL, &$view=NULL)
setPropertyValues($property, $values)
Sets the values of a property for each item in the collection.
setProperties($properties)
insertItem($item, $position=0)
setItemIdentifier($item, $classname, $index)
fromDatabaseObject($object, $function)
addContent($content, $before=false)
static shortClassName($object)