public function index() { Log::debug('aaa'); //Test::get(); Test::query()->select('*')->get(); return View::make('pages.test.index'); }
<?php include '../lib/common.inc.php'; $title = "Администрирование re:tester"; $tests = Test::query("SELECT id, name, (SELECT count(*) FROM questions where test_id=tests.id) AS question_count FROM tests ORDER BY name"); render('list.haml', array('tests' => $tests, 'tab' => 'all-tests', 'active_test_id' => $_GET['test_id']));
<?php include '../lib/common.inc.php'; loginkit_require('logged-in'); $partner = loginkit_current_user(); $tests = Test::query("SELECT id, name FROM tests ORDER BY name"); $host = $_SERVER['HTTP_HOST']; foreach ($tests as &$test) { $test->url = "http://{$host}/tests/{$test->id}/P{$partner->id}"; } unset($test); $title = "Ваши ссылки"; render('banners.haml', array('partner' => $partner, 'tests' => $tests, 'tab' => 'banners'));