You are here

public function RateButton::__toString in Rate 7.2

Get HTML code for button.

File

classes/button.inc, line 69

Class

RateButton

Code

public function __toString() {
  $classes = array(
    'rate-button',
    "button{$this->id}",
  );
  if ($this->class) {
    $classes[] = $this->class;
  }
  return theme('link', array(
    'text' => $this->label,
    'path' => $_GET['q'],
    'options' => array(
      'attributes' => array(
        'rel' => 'nofollow',
        'class' => $classes,
        'data-token' => $this->token,
      ),
      'query' => array(
        'rate' => $this->token,
      ),
      'html' => $this->html,
    ),
  ));
}