Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: PHP  |  size: 0.54 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class Form {
  2.         public function addText($x, $y) {
  3.                 $return = "<input type=\"text\" name=\"".$x."\" value=\"".$y."\"";
  4.                 $return .= " />";
  5.                 echo $return;
  6.         }
  7. }
  8. $form = new Form;
  9. $form->addText('zvire', 'pes'); // vypíše mě: <input type="text" name="zvire" value="pes" />
  10. $form->addText('zvire', 'pes')->addTitle('Napiš zvíře'); // vypíše mě: <input type="text" name="zvire" value="pes" title="Napiš zvíře" />
  11.  
  12. // A jde o to jak to zapsat v té tříde ten druhý příklad aby to vlastně přidalo do return to title="Napiš zvíře"