当前位置: 首页>>代码示例>>PHP>>正文


PHP Test::all方法代码示例

本文整理汇总了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);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:7,代码来源:home.php

示例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);
 }
开发者ID:ebuzz,项目名称:SAPE_CAR,代码行数:8,代码来源:ResultsController.php

示例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) . '}';
 }
开发者ID:joeymetal,项目名称:restful-sdti,代码行数:12,代码来源:TestController.php

示例4: getIndex

 public function getIndex()
 {
     $tests = Test::all();
     $this->layout->content = view::make('tests.index', compact('tests'));
 }
开发者ID:bhargavmehta,项目名称:laravel-demo,代码行数:5,代码来源:TestsController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tests = Test::all();
     return $this->respond($this->transformCollection($tests));
 }
开发者ID:SenhorBardell,项目名称:wordotheday,代码行数:10,代码来源:TestsController.php

示例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'));
 }
开发者ID:joelmwas,项目名称:bimareport,代码行数:11,代码来源:TestsController.php

示例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);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:29,代码来源:promotion.php

示例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);
     }
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:32,代码来源:medicaltest.php

示例9: modelTest

 public function modelTest()
 {
     $db = new Test();
     $result = $db->all();
     pad($result);
 }
开发者ID:sepehr-gh,项目名称:stewie,代码行数:6,代码来源:HelloController.php

示例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)
}
开发者ID:poseidonjm,项目名称:invoice-ninja,代码行数:31,代码来源:test.php


注:本文中的Test::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。