Skip to content

Instantly share code, notes, and snippets.

@paulslugocki
Created January 5, 2012 17:54
Show Gist options
  • Save paulslugocki/1566363 to your computer and use it in GitHub Desktop.
Save paulslugocki/1566363 to your computer and use it in GitHub Desktop.
<?php
class Tour extends Mustache {
public function populate($id) {
global $tourcms;
global $channel_id;
$result = $tourcms->show_tour($id, $channel_id);
$this->error = (string)$result->error;
if($this->error=="OK") {
foreach ($result->tour->children() as $element => $value) {
$this->$element = $value;
}
}
}
public function nl2brLongdesc() {
return nl2br($this->longdesc);
}
/*
public function nl2br() { return array($this, 'doNl2br'); }
public function doNl2br($text) { return $text; }
public $snl2br = array($this, 'dosnl2br');
public function dosnl2br($text) {
print(nl2br($this->render($text)));
}*/
public function isok() {
return (string)$this->error==="OK";
}
public function notok() {
return !$this->isok();
}
/*
public function taxed_value() {
return $this->value - ($this->value * 0.4);
}*/
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment