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


PHP Package::find_all方法代码示例

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


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

示例1: index

 public function index()
 {
     $this->set_default_side_bar();
     $this->title = 'All Packages';
     Nimble::set_title($this->title);
     $page = isset($_GET['page']) ? $_GET['page'] : NULL;
     switch ($this->format) {
         case 'xml':
             $this->packages = Package::find_all();
             $this->header('Content-Type: text/xml', 200);
             echo $this->packages->to_xml();
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'json':
             $this->packages = Package::find_all();
             $this->header('Content-type: application/json', 200);
             echo $this->packages->to_json();
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'atom':
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'rss':
             $this->layout = false;
             $this->has_rendered = true;
             break;
         default:
             $this->full = true;
             $this->packages = Package::paginate(array('select' => '`packages`.*, AVG(`package_ratings`.`rating`) as rating', 'order' => 'rating DESC', 'per_page' => 20, 'page' => $page, 'joins' => 'LEFT JOIN `package_ratings` on `package_ratings`.`package_id` = `packages`.`id`', 'group' => '`packages`.id'));
             break;
     }
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:35,代码来源:package_controller.php

示例2: search

 public function search()
 {
     $methods = get_class_methods($this);
     $sql = array();
     foreach ($methods as $method) {
         $matches = array();
         if (preg_match('/([a-zA-z0-9_]+)_conditions$/', $method, $matches)) {
             $retrun = call_user_func(array($this, $method));
             if (!empty($return)) {
                 $sql[] = NimbleRecord::sanitize($return);
             }
         }
     }
     $conditions = implode(' ', $sql);
     return Package::find_all(array('conditions' => $conditions));
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:16,代码来源:package_search.php

示例3: Package

<?php

require_once "../initialise_files.php";
include_once "sessioninc.php";
$packages = Package::find_all();
$smarty->assign('packages', $packages);
if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "delete") {
    $package = new Package();
    $package->id = (int) $_GET['id'];
    if ($package->delete()) {
        $session->message("<div class='success'>Package has been deleted.</div>");
        redirect_to($_SERVER['PHP_SELF']);
        die;
    } else {
        $message = "<div class='error'> Problem deleteing package</div>";
    }
}
$html_title = SITE_NAME . " List Packages ";
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('admin/list_packages.tpl'));
$smarty->display('admin/index.tpl');
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:22,代码来源:list_packages.php


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