diff options
author | Simon | 2011-01-28 09:48:04 +0100 |
---|---|---|
committer | Simon | 2011-01-28 09:48:04 +0100 |
commit | 24468f6a2244b07e7c56eb80523bf63341f486cd (patch) | |
tree | 545fa06c2728023f36b2eb5b4c834783f210b456 /public/settergetter.php | |
parent | settergetter für variablen - um nicht tausend sachen ändern zu müssen (diff) | |
download | pbs2-24468f6a2244b07e7c56eb80523bf63341f486cd.tar.gz pbs2-24468f6a2244b07e7c56eb80523bf63341f486cd.tar.xz pbs2-24468f6a2244b07e7c56eb80523bf63341f486cd.zip |
setter/getter geändert damit es Konvention setGrossbuchstabe() entspricht
Diffstat (limited to 'public/settergetter.php')
-rw-r--r-- | public/settergetter.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/public/settergetter.php b/public/settergetter.php index 42f73ef..c9f0016 100644 --- a/public/settergetter.php +++ b/public/settergetter.php @@ -4,14 +4,14 @@ function setget($name){ $withdash = $name; $withoutdash = substr($name,1); return -' public function get'.ucfirst($withoutdash).'() - { - return $this->'.$withdash.'; - } - public function set'.ucfirst($withoutdash).'($'.$withdash.') - { - $this->'.$withdash.' = $'.$withdash.'; - } +' public function get'.ucfirst($withoutdash).'() + { + return $this->'.$withdash.'; + } + public function set'.ucfirst($withoutdash).'($'.$withdash.') + { + $this->'.$withdash.' = $'.$withdash.'; + } '; } if(isset($_POST['submit'])){ @@ -27,6 +27,7 @@ if(isset($_POST['submit'])){ else{ ?> +Jeweils ein Variablenname pro Zeile:<br> <form method='post' action='<?php $_SERVER['PHP_SELF'];?>'> <textarea name='variables'> </textarea><br> |