parent::__construct($opt);
if (!$this->params['db']) $this->not_implemented('Db missing');
- // Post defaults values
- if (empty($this->ext)) $this->ext = $this->params['format'];
-
//
// Page
require_once(NB_ROOT.'/lib/php/page.php');
public function page($obj,$meth=null,$head=[],$fct=null) {
if (empty($this->_nopage)) {
- $this->init();
+ // Write output
+ $this->page_colors();
+ $this->page->headers_no_cache();
+ $this->page->begin();
}
#die($obj);
}
+ // Post defaults values
+ if (empty($this->ext)) $this->ext = $format;
+
if ($format == 'html') $format = 'table';
$this->params['format'] = $format;
$this->db->format = $format;
if (empty($content_type)) $content_type = Mime::fromExt($format=='human' ? 'txt' : $format);
if ($content_type) $this->page->content_type($content_type);
- // Write output
- $this->page_colors();
- $this->page->headers_no_cache();
- $this->page->begin();
}
public function run() {
# Db Init
#
$this->db();
+ $this->init();
#
# Root actions pre conn