Skip to content

Commit

Permalink
abstracting some logic out for better customization
Browse files Browse the repository at this point in the history
  • Loading branch information
zeelot committed Aug 12, 2010
1 parent b401f69 commit 596d540
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions classes/yuriko/yform/element.php
Expand Up @@ -88,15 +88,26 @@ public function load_settings(YForm $settings)
$this->set_value($settings->get_value($this->_path)); $this->set_value($settings->get_value($this->_path));
} }


// Using the dot-notated path to grab messages $this->extract_messages($settings);
$this->_messages = Arr::merge($this->_messages, $settings->get_messages($this->_path, array()));


// Replace the default theme in this element // Replace the default theme in this element
$this->set_theme($settings->theme); $this->set_theme($settings->theme);


return $this; return $this;
} }


/**
* Takes any related messages out of a YForm object and adds them to the element
*
@param object $settings
* @return self
*/
public function extract_messages(YForm $settings)
{
// Using the dot-notated path to grab messages
$this->_messages = Arr::merge($this->_messages, $settings->get_messages($this->_path, array()));
}

/** /**
* Appends classes to this object * Appends classes to this object
* *
Expand Down

0 comments on commit 596d540

Please sign in to comment.