本文整理汇总了PHP中View::view方法的典型用法代码示例。如果您正苦于以下问题:PHP View::view方法的具体用法?PHP View::view怎么用?PHP View::view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::view方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_wifi_data
/**
* Get WiFi information for serial_number
*
* @param string $serial serial number
**/
public function get_wifi_data($serial_number = '')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$wifi = new wifi_model($serial_number);
$obj->view('json', array('msg' => $wifi->rs));
}
示例2: View
/**
* Retrieve data in json format
*
* @return void
* @author
**/
function get_data($serial_number = '')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$service = new Service_model();
$obj->view('json', array('msg' => $service->retrieve_records($serial_number)));
}
示例3: View
/**
* Retrieve data in json format
*
**/
function get_data($serial_number = '')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$ard = new Ard_model($serial_number);
$obj->view('json', array('msg' => $ard->rs));
}
示例4: get_low
/**
* Get low battery devices
*
*
**/
public function get_low()
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$bt = new Bluetooth_model();
$obj->view('json', array('msg' => $bt->get_low()));
}
示例5: View
function get_map_data()
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$location = new Location_model();
$obj->view('json', array('msg' => $location->get_map_data()));
}
示例6: View
/**
* Get stats
*
**/
function get_stats()
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$cert = new Certificate_model();
$obj->view('json', array('msg' => $cert->get_stats()));
}
示例7: get_printers
/**
* Get printer information for printer widget
*
* @return void
* @author John Eberle (tuxudo)
**/
public function get_printers()
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => array('error' => 'Not authenticated')));
return;
}
$printers = new Printer_model();
$obj->view('json', array('msg' => $printers->get_printers()));
}
示例8: get_modified_computernames
/**
* Get Modified Computer names
*
*
**/
public function get_modified_computernames()
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => array('error' => 'Not authenticated')));
return;
}
$dm = new Directory_service_model();
$obj->view('json', array('msg' => $dm->get_modified_computernames()));
}
示例9: get_count
/**
* Get count of displays
*
*
* @param int $type type 1 is external, type 0 is internal
**/
public function get_count($type = 1)
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => array('error' => 'Not authenticated')));
return;
}
$dim = new Displays_info_model();
$obj->view('json', array('msg' => $dim->get_count($type)));
}
示例10: View
/**
* Get timemachine stats
*
* @return void
* @author
**/
function get_stats($hours = 24)
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$timemachine = new Timemachine_model();
$obj->view('json', array('msg' => $timemachine->get_stats($hours)));
}
示例11: get_groups
/**
* Get statistics
*
* Get statistics grouped by type
*
* @param String type group by region_name or site_name
**/
public function get_groups($type = '')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
return;
}
$site_info = new Site_info_model();
$obj->view('json', array('msg' => $site_info->get_groups($type)));
}
示例12: View
/**
* Retrieve data in json format
*
* @return void
* @author
**/
function get_data($serial_number = '')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => 'Not authorized'));
}
$out = array();
$model = new Crashplan_model();
foreach ($model->retrieve_records($serial_number) as $record) {
$out[] = $record->rs;
}
$obj->view('json', array('msg' => $out));
}
示例13: View
/**
* Get statistics
*
* @return void
* @author
**/
function get_stats($mount_point = '/')
{
$obj = new View();
if (!$this->authorized()) {
$obj->view('json', array('msg' => array('error' => 'Not authenticated')));
return;
}
$disk_report = new Disk_report_model();
$out = array();
$thresholds = conf('disk_thresholds', array('danger' => 5, 'warning' => 10));
$out['thresholds'] = $thresholds;
$out['stats'] = $disk_report->get_stats($mount_point, $thresholds['danger'], $thresholds['warning']);
$obj->view('json', array('msg' => $out));
}
示例14: init
public static function init($viewtype, $config)
{
self::$view = new $viewtype();
foreach ($config as $key => $value) {
self::$view->{$key} = $value;
}
}
示例15: age
/**
* Generate age data for age widget
*
* @author AvB
**/
function age()
{
// Authenticate
if (!$this->authorized()) {
die('Authenticate first.');
// Todo: return json?
}
$out = array();
$warranty = new Warranty_model();
// Time calculations differ between sql implementations
switch ($warranty->get_driver()) {
case 'sqlite':
$agesql = "CAST(strftime('%Y.%m%d', 'now') - strftime('%Y.%m%d', purchase_date) AS INT)";
break;
case 'mysql':
$agesql = "TIMESTAMPDIFF(YEAR,purchase_date,CURDATE())";
break;
default:
// FIXME for other DB engines
$agesql = "SUBSTR(purchase_date, 1, 4)";
}
$sql = "SELECT count(1) as count, \n\t\t\t\t{$agesql} AS age \n\t\t\t\tFROM warranty\n\t\t\t\tGROUP by age \n\t\t\t\tORDER BY age DESC";
$cnt = 0;
foreach ($warranty->query($sql) as $obj) {
$obj->age = $obj->age ? $obj->age : '<1';
$out[] = array('label' => $obj->age, 'data' => array(array(intval($obj->count), $cnt++)));
}
$obj = new View();
$obj->view('json', array('msg' => $out));
}