Beispiel #1
0
 /**
  * Returns or sets the text contents of this element,
  * including descendants.
  *
  * @link http://api.jquery.com/text/
  *
  * @param string|CDomNode|CDomNode[]|CDomNodesList $value
  *
  * @return string|$this
  */
 public function text($value = null)
 {
     // Set
     if ($value !== null) {
         // array
         if (is_array($value)) {
             $list = new CDomNodesList();
             $list->list = $value;
             $value = $list->textAll();
         } else {
             if (is_object($value)) {
                 // nodes list
                 if ($value instanceof CDomNodesList) {
                     $value = $value->textAll();
                 } else {
                     $value = $value->text();
                 }
             }
         }
         return $this->value = (string) $value;
     }
     // Get
     return $this->value;
 }