summaryrefslogtreecommitdiffstats
path: root/public/settergetter.php
diff options
context:
space:
mode:
authorSebastian Schmelzer2012-01-11 14:36:35 +0100
committerSebastian Schmelzer2012-01-11 14:36:35 +0100
commitfca04a6dab252eb9e8c0a92ce3b7e14b32e68d1e (patch)
tree6e6aaf749f34db8c7c7153c23ef85c57187430bb /public/settergetter.php
parentAPI: mit addBootos kann man nun auch editieren (diff)
downloadpbs2-fca04a6dab252eb9e8c0a92ce3b7e14b32e68d1e.tar.gz
pbs2-fca04a6dab252eb9e8c0a92ce3b7e14b32e68d1e.tar.xz
pbs2-fca04a6dab252eb9e8c0a92ce3b7e14b32e68d1e.zip
format source files
Diffstat (limited to 'public/settergetter.php')
-rw-r--r--public/settergetter.php64
1 files changed, 32 insertions, 32 deletions
diff --git a/public/settergetter.php b/public/settergetter.php
index 9b603d7..ac7ce8a 100644
--- a/public/settergetter.php
+++ b/public/settergetter.php
@@ -1,4 +1,4 @@
-<?php
+<? php
/*
* Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
* This program is free software distributed under the GPL version 2.
@@ -9,40 +9,40 @@
*
* General information about OpenSLX can be found at http://openslx.org/
*/
-function print_a($v){echo"<pre style='background-color:#FFCC33'>";print_r($v);echo"</pre>";}
-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.';
- }
-';
+function print_a($v) {echo"<pre style='background-color:#FFCC33'>"; print_r($v); echo"</pre>";}
+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.';
+ }
+ ';
}
-if(isset($_POST['submit'])){
- $ar = explode("\n",trim($_POST['variables']));
+if(isset($_POST['submit'])) {
+ $ar = explode("\n", trim($_POST['variables']));
- $output = "";
- foreach($ar as $item){
- $output .= setget("_".trim($item));
- }
- print_a($output);
- echo "<a href='".$_SERVER['PHP_SELF']."'>back</a>";
+ $output = "";
+ foreach($ar as $item) {
+ $output . = setget("_".trim($item));
+ }
+ print_a($output);
+ echo "<a href='".$_SERVER['PHP_SELF']."'>back</a>";
}
-else{
-?>
-Jeweils ein Variablenname pro Zeile:<br>
-<form method='post' action='<?php $_SERVER['PHP_SELF'];?>'>
-<textarea name='variables'>
-</textarea><br>
-<input type='submit' name='submit' value='setter und getter generieren'>
-</form>
-<?php
+else {
+ ? >
+ Jeweils ein Variablenname pro Zeile : <br>
+ < form method = 'post' action = '<?php $_SERVER['PHP_SELF'];?>' >
+ < textarea name = 'variables' >
+ < / textarea > <br>
+ < input type = 'submit' name = 'submit' value = 'setter und getter generieren' >
+ < / form >
+ <? php
}