index.php 696 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. include_once '../../debug.php';
  3. include_once '../pquery.php';
  4. __p::require_plugins('array', 'sql', 'template');
  5. // Array test
  6. /*$a = _p(range(0, 10));
  7. while( !$a->is_empty() ) {
  8. debug($a->pop(), $a->reverse()->pop());
  9. }*/
  10. // SQL test
  11. /*$sql = _sql("select * from posts where slug = '[slug]'")
  12. ->set(array('slug' => 'contact'));
  13. $results = $sql->fetch_all('object');
  14. $results = _arr($results);
  15. debug($results);*/
  16. __tpl::set_root('templates', false);
  17. $tpl = _tpl('test.tpl');
  18. $test1 = $tpl->data->add('test1', array('var' => 'some-variable'));
  19. $tpl->data->add('test1', array('var' => 'some-other-variable'));
  20. $test1->add('test2');
  21. $tpl->data->add('test3');
  22. debug($tpl->parse());
  23. ?>