Permalink
Browse files

added url arguments to the controller methods

  • Loading branch information...
1 parent a4a20f7 commit 8c729e1820b83fc7e1283db6e7a13f6db73daafc @dicabrio committed Apr 15, 2011
@@ -6,8 +6,6 @@ class FormElementImpl implements FormElement {
private $node;
- private $mapping;
-
public function __construct($nodename, $name, $value=null) {
$this->node = $nodename;
$this->addAttribute('name', $name);
@@ -27,6 +25,12 @@ public function addAttribute($name, $value) {
}
+ public function removeAttribute($name) {
+ if (isset($this->attributes[$name])) {
+ unset($this->attributes[$name]);
+ }
+ }
+
/**
*
* @return string
@@ -22,7 +22,7 @@ public function __construct($name, $value = null, $checked = false) {
/**
* Because there can be multiple radiobuttons. The identifier is build out of the
* name and the value
- *
+ *
* @return string
*/
public function getIdentifier() {
@@ -37,6 +37,8 @@ public function getIdentifier() {
public function setValue($val) {
if ($val == $this->getValue()) {
$this->addAttribute('checked', 'checked');
+ } else {
+ $this->removeAttribute('checked');
}
}
@@ -45,8 +47,8 @@ public function setValue($val) {
*/
public function isSelected() {
- return ('checked' == parent::getAttribute('checked'));
-
+ return ('checked' == $this->getAttribute('checked'));
+
}
}
@@ -73,7 +73,12 @@ public function execute() {
$controller = $reflection->newInstance($oReflMethod->getName());
$controller->setArguments($this->arguments);
- $this->result = $oReflMethod->invokeArgs($controller, array());
+ $aArguments = array();
+ if (isset($this->arguments['url'])) {
+ $aArguments = explode('/', str_replace($this->controller . '/' . $method . '/', '', $this->arguments['url']));
+ }
+ $this->result = $oReflMethod->invokeArgs($controller, $aArguments);
+// $this->result = $oReflMethod->invokeArgs($controller, array());
}
public function decode($newData) {

0 comments on commit 8c729e1

Please sign in to comment.