本文整理汇总了PHP中Test::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::all方法的具体用法?PHP Test::all怎么用?PHP Test::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Test
的用法示例。
在下文中一共展示了Test::all方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->getLayoutView()->set("seo", Framework\Registry::get("seo"));
$view = $this->getActionView();
$alltests = Test::all(array(), array("id", "title"));
$view->set("alltests", $alltests);
}
示例2: showResults
public function showResults()
{
$data = array('title' => 'Resultados');
$data['sports'] = Sport::all()->lists('description', 'idSport');
$data['tests'] = Test::all()->lists('name', 'idTest');
$data['cities'] = City::all()->lists('description', 'idCity');
return View::make('results', $data);
}
示例3: get_listall
function get_listall()
{
$result = array();
#$sql = Test::find('all');
$sql = Test::all();
foreach ($sql as $data) {
array_push($result, $data->to_array());
//using to_array instead of to_json
}
#echo json_encode($result);
return '{"result": ' . json_encode($result) . '}';
}
示例4: getIndex
public function getIndex()
{
$tests = Test::all();
$this->layout->content = view::make('tests.index', compact('tests'));
}
示例5: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$tests = Test::all();
return $this->respond($this->transformCollection($tests));
}
示例6: index
/**
* Display a listing of the resource.
* GET /tests
*
* @return Response
*/
public function index()
{
$tests = Test::all();
return View::make('tests.index', compact('tests'));
}
示例7: popularOffers
public function popularOffers()
{
$this->seo(array("title" => "Popular Offers", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$organizations = Organization::all(array("live = ?" => true), array("id", "name"));
$packages = Package::all(array(), array("title", "id"));
$tests = Test::all(array(), array("title", "id"));
$limit = RequestMethods::get("limit", 10);
$page = RequestMethods::get("page", 1);
$offers = Offer::all(array("live = ?" => 1), array("*"), "created", "desc", $limit, $page);
$total = (int) Offer::count(array("live = ?" => 1));
$results = array();
foreach ($offers as $o) {
$type = array();
switch ($o->property) {
case 'test':
$type['title'] = $tests[$o->property_id]->title;
$type['id'] = $o->property_id;
break;
case 'package':
$type['title'] = $packages[$o->property_id]->title;
$type['id'] = $o->property_id;
break;
}
$data = array("id" => $o->id, "start" => StringMethods::datetime_to_text($o->start), "end" => StringMethods::datetime_to_text($o->end), "percent" => $o->percent, "type" => $o->property, "type_title" => $type['title'], "type_id" => $type['id'], "lab" => $organizations[$o->organization_id], "lab_id" => $o->organization_id);
$results[] = ArrayMethods::toObject($data);
}
$view->set("offers", $results)->set("total", $total);
}
示例8: download
/**
* @before _secure, _vendor
*/
public function download()
{
$this->noview();
$tests = Test::all(array("live = ?" => true), array("title"));
$centres = Centre::all(array("organization_id = ?" => $this->organization->id), array("location_id"));
$locations = array();
foreach ($centres as $centre) {
$loc = Location::first(array("id = ?" => $centre->location_id), array("city"));
array_push($locations, $loc->city);
}
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=medicaltests.csv');
// create a file pointer connected to the output stream
$output = fopen('php://output', 'w');
$first = array("Medical Test");
$locations = array_unique($locations);
foreach ($locations as $location) {
array_push($first, "Price at " . $location);
}
fputcsv($output, $first);
foreach ($tests as $test) {
$data = array();
array_push($data, $test->title);
foreach ($locations as $location) {
array_push($data, "");
}
fputcsv($output, $data);
}
}
示例9: modelTest
public function modelTest()
{
$db = new Test();
$result = $db->all();
pad($result);
}
示例10: all
* Run All Tests
*/
public function all()
{
foreach (scandir('tests') as $test) {
if ($test[0] !== '.' && !is_dir($this->dir . '/tests/tests/' . $test)) {
include "tests/{$test}";
$class_name = 'Test_' . ucfirst(str_replace('.php', '', $test));
$test_instance = new $class_name($this->dir);
$test_instance->run();
}
}
}
public function destruct()
{
echo "Thankyou for choosing PHP-Payments! Please send questions, comments or donations (via PayPal) to calvinfroedge@gmail.com. If you find a bug, please post it in the issues section of the Git repository: https://github.com/calvinfroedge/PHP-Payments \n \n";
}
}
$test = new Test();
//The 0th element is simply the filename. Get rid of it and reindex the array.
unset($argv[0]);
$argv = array_values($argv);
if (empty($argv)) {
$test->all();
} else {
$test_name = $argv[0];
//This should be the name of the test to run
unset($argv[0]);
$test->single($test_name, $argv);
//Passing rest of the params to a specific test to set it's options (if any)
}