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


PHP Type::getAll方法代码示例

本文整理汇总了PHP中Type::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getAll方法的具体用法?PHP Type::getAll怎么用?PHP Type::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Type的用法示例。


在下文中一共展示了Type::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionIndex

 public function actionIndex()
 {
     //$searchModel = new Type;
     //$dataProvider = $searchModel->pageAll(Yii::$app->request->queryParams);
     //return $this->render('index', [
     // 'dataProvider' => $dataProvider,
     //]);
     $model = new Type();
     $arr['obj'] = $model->getAll();
     $arr['f_name'] = $model->getAll(['f_id' => "0"]);
     return $this->renderPartial('index', $arr);
 }
开发者ID:hardshen,项目名称:niuke,代码行数:12,代码来源:TypeController.php

示例2: find

 static function find($search_id)
 {
     $found_type = null;
     $types = Type::getAll();
     foreach ($types as $type) {
         $type_id = $type->getId();
         if ($type_id == $search_id) {
             $found_type = $type;
         }
     }
     return $found_type;
 }
开发者ID:jmalo34,项目名称:Inventory_Collection,代码行数:12,代码来源:Type.php

示例3: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $descript = "Event Keepsakes";
     $descript2 = "Antiques";
     $test_Type = new Type($descript);
     $test_Type->save();
     $test_Type2 = new Type($descript2);
     $test_Type2->save();
     //Act
     Type::deleteAll();
     $result = Type::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:jmalo34,项目名称:Inventory_Collection,代码行数:15,代码来源:TypeTest.php

示例4: function

});
$app->get('/trainers/:id/badges', function ($id) use($app) {
    $trainer = Trainer::getById($id);
    sendResponse($trainer->getBadges());
});
$app->get('/gyms', function () use($app) {
    sendResponse(Gym::getAll());
});
$app->get('/gyms/:id', function ($id) use($app) {
    $gym = Gym::getById($id);
    sendResponse($gym->serialize());
});
$app->get('/gyms/:id/leader', function ($id) use($app) {
    $gym = Gym::getById($id);
    sendResponse($gym->getLeader()->serialize());
});
$app->get('/types', function () use($app) {
    sendResponse(Type::getAll());
});
$app->get('/types/:id', function ($id) use($app) {
    $type = Type::getById($id);
    sendResponse($type->serialize());
});
$app->get('/badges', function () use($app) {
    sendResponse(Badge::getAll());
});
$app->get('/badges/:id', function ($id) use($app) {
    $badge = Badge::getById($id);
    sendResponse($badge->serialize());
});
$app->run();
开发者ID:EPICmynamesBG,项目名称:PokemonDB,代码行数:31,代码来源:index.php

示例5: function

});
$app->get("/types", function () use($app) {
    return $app['twig']->render('types.html.twig', array('types' => Type::getAll()));
});
$app->get("/searches", function () use($app) {
    return $app['twig']->render('searches.html.twig', array('searches' => Search::getAll()));
});
$app->post("/collections", function () use($app) {
    $collection = new Collection($_POST['thing']);
    $collection->save();
    return $app['twig']->render('collections.html.twig', array('collections' => Collection::getAll()));
});
$app->post("/types", function () use($app) {
    $type = new Type($_POST['descript']);
    $type->save();
    return $app['twig']->render('types.html.twig', array('types' => Type::getAll()));
});
$app->post("/searches", function () use($app) {
    $search = new Search($_POST['find']);
    $search->save();
    return $app['twig']->render('searches.html.twig', array('searches' => Search::getAll()));
});
$app->post("/delete_collections", function () use($app) {
    Collection::deleteAll();
    return $app['twig']->render('delete_collections.html.twig');
});
$app->post("/delete_types", function () use($app) {
    Type::deleteAll();
    return $app['twig']->render('delete_types.html.twig');
});
return $app;
开发者ID:jmalo34,项目名称:Inventory_Collection,代码行数:31,代码来源:app.php

示例6: getSelect

 function getSelect()
 {
     $results = Type::getAll("title");
     foreach ($results as $row) {
         $temp[] = array("value" => $row['id'], "label" => stripslashes($row['title']));
     }
     return $temp;
 }
开发者ID:npedrini,项目名称:anthroposts,代码行数:8,代码来源:type.class.php


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