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


PHP Field::inst方法代码示例

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


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

示例1: postData

 /**
  * [postData]
  * @return [type] [description]
  */
 public function postData()
 {
     $Model = $this->modelName;
     // Build our Editor instance and process the data coming from _POST
     global $db;
     $data = Editor::inst($db, 'reminders')->fields(Field::inst('reminders.id'), Field::inst('reminders.project_id'), Field::inst('projects.name'), Field::inst('reminders.user_id'), Field::inst('users.username'), Field::inst('reminders.description'))->leftJoin('users', 'users.id', '=', 'reminders.user_id')->leftJoin('projects', 'projects.id', '=', 'reminders.project_id')->process($_POST)->data();
     //->json;
     $data['projects'] = $db->selectDistinct('projects', 'id as value, name as label')->fetchAll();
     $data['users'] = $db->selectDistinct('users', 'id as value, username as label')->fetchAll();
     //echo json_encode($ret);
     return Response::json($data);
 }
开发者ID:strikles,项目名称:php,代码行数:16,代码来源:AdminReminderController.php

示例2:

<?php

/*
 * Editor server script for DB table EMPLOYEE
 * Created by http://editor.datatables.net/generator
 */
// DataTables PHP library and database connection
include "lib/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'CUSTOMER', 'ID_Customer')->fields(Field::inst('ID_Customer'), Field::inst('Name_Customer'), Field::inst('Email_Customer'), Field::inst('Uname_Customer'), Field::inst('PassW_Customer'), Field::inst('Phone_Customer'))->process($_POST)->json();
开发者ID:veltamahesa,项目名称:GujekWebApp,代码行数:12,代码来源:table.CUSTOMER.php

示例3: json_encode

<?php

/*
 * Example PHP implementation used for the index.html example
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
$out = Editor::inst($db, 'datatables_demo')->fields(Field::inst('id')->set(false), Field::inst('first_name')->validator('Validate::notEmpty'), Field::inst('last_name')->validator('Validate::notEmpty'), Field::inst('position'), Field::inst('email'), Field::inst('office'), Field::inst('extn')->validator('Validate::numeric'), Field::inst('age')->validator('Validate::numeric'), Field::inst('salary')->validator('Validate::numeric'), Field::inst('start_date')->validator('Validate::dateFormat', array("format" => Format::DATE_ISO_8601, "message" => "Please enter a date in the format yyyy-mm-dd"))->getFormatter('Format::date_sql_to_format', Format::DATE_ISO_8601)->setFormatter('Format::date_format_to_sql', Format::DATE_ISO_8601))->process($_POST)->data();
// On 'read' remove the DT_RowId property so we can see fully how the `idSrc`
// option works on the client-side.
if (Editor::action($_POST) === Editor::ACTION_READ) {
    for ($i = 0, $ien = count($out['data']); $i < $ien; $i++) {
        unset($out['data'][$i]['DT_RowId']);
    }
}
// Send it back to the client
echo json_encode($out);
开发者ID:FaTTeST,项目名称:billenv,代码行数:20,代码来源:jsonId.php

示例4: isset

<?php

/*
 * Example PHP implementation used for date examples
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Allow a number of different formats to be submitted for the various demos
$format = isset($_GET['format']) ? $_GET['format'] : '';
if ($format === 'custom') {
    $update = 'n/j/Y';
    $registered = 'l j F Y';
} else {
    $update = Format::DATE_ISO_8601;
    $registered = Format::DATE_ISO_8601;
}
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'users')->fields(Field::inst('first_name'), Field::inst('last_name'), Field::inst('updated_date')->validator('Validate::dateFormat', array('empty' => false, 'format' => $update))->getFormatter('Format::date_sql_to_format', $update)->setFormatter('Format::date_format_to_sql', $update), Field::inst('registered_date')->validator('Validate::dateFormat', $registered)->getFormatter('Format::date_sql_to_format', $registered)->setFormatter('Format::date_format_to_sql', $registered))->process($_POST)->json();
开发者ID:kienbk1910,项目名称:RDCAdmin,代码行数:20,代码来源:dates.php

示例5:

<?php

/*
 * Editor server script for DB table EMPLOYEE
 * Created by http://editor.datatables.net/generator
 */
// DataTables PHP library and database connection
include "lib/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'SOFTWARE_ENG', 'ID_SWeng')->fields(Field::inst('ID_SWeng'))->process($_POST)->json();
开发者ID:veltamahesa,项目名称:GujekWebApp,代码行数:12,代码来源:table.SOFTENG.php

示例6:

<?php

// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
/*
 * Example PHP implementation used for the join.html example
 */
Editor::inst($db, 'users')->field(Field::inst('users.first_name'), Field::inst('users.last_name'), Field::inst('users.site')->options('sites', 'id', 'name'), Field::inst('sites.name'))->leftJoin('sites', 'sites.id', '=', 'users.site')->join(Mjoin::inst('access')->link('users.id', 'user_access.user_id')->link('access.id', 'user_access.access_id')->fields(Field::inst('id')->validator('Validate::required')->options('access', 'id', 'name'), Field::inst('name')))->process($_POST)->json();
开发者ID:kienbk1910,项目名称:RDCAdmin,代码行数:10,代码来源:joinArray.php

示例7: array

<?php

/*
 * Example PHP implementation used for the index.html example
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'users')->fields(Field::inst('first_name'), Field::inst('last_name'), Field::inst('updated_date')->validator('Validate::dateFormat', array("empty" => false, "format" => Format::DATE_ISO_8601, "message" => "Please enter a date in the format yyyy-mm-dd"))->getFormatter('Format::date_sql_to_format', Format::DATE_ISO_8601)->setFormatter('Format::date_format_to_sql', Format::DATE_ISO_8601), Field::inst('registered_date')->validator('Validate::dateFormat', 'D, d M y')->getFormatter('Format::date_sql_to_format', 'D, d M y')->setFormatter('Format::date_format_to_sql', 'D, d M y'))->process($_POST)->json();
开发者ID:Symfomany,项目名称:papsymfony,代码行数:11,代码来源:dates.php

示例8:

<?php

/*
 * Example PHP implementation used for the checkbox.html example
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'users')->fields(Field::inst('first_name'), Field::inst('last_name'), Field::inst('phone'), Field::inst('city'), Field::inst('zip'), Field::inst('active')->setFormatter(function ($val, $data, $opts) {
    return !$val ? 0 : 1;
}))->process($_POST)->json();
开发者ID:kienbk1910,项目名称:RDCAdmin,代码行数:13,代码来源:checkbox.php

示例9:

<?php

require_once Yii::app()->basePath . '/extensions/editor_datatables/php/DataTables.php';
//Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'trade_types', 'id')->fields(Field::inst('id'), Field::inst('trade_type'))->process($_POST)->json();
开发者ID:artmart,项目名称:verare,代码行数:7,代码来源:tradetypes.php

示例10:

<?php

/*
 * Editor server script for DB table EMPLOYEE
 * Created by http://editor.datatables.net/generator
 */
// DataTables PHP library and database connection
include "lib/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'TR_TRANSPORT', 'T_Trans_No')->fields(Field::inst('T_Trans_No'), Field::inst('T_Destination'))->process($_POST)->json();
开发者ID:veltamahesa,项目名称:GujekWebApp,代码行数:12,代码来源:table.TRANS.php

示例11:

<?php

/*
 * Editor server script for DB table EMPLOYEE
 * Created by http://editor.datatables.net/generator
 */
// DataTables PHP library and database connection
include "lib/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'RESTAURANT', 'Name_Restaurant')->fields(Field::inst('Name_Restaurant'), Field::inst('Menu_Restaurant'), Field::inst('Price_Restaurant'), Field::inst('Address_Restaurant'), Field::inst('Phone_Restaurant'))->process($_POST)->json();
开发者ID:veltamahesa,项目名称:GujekWebApp,代码行数:12,代码来源:table.RESTAURANT.php

示例12: array

<?php

/*
 * Example PHP implementation used for date time examples
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'users')->fields(Field::inst('first_name'), Field::inst('last_name'), Field::inst('updated_date')->validator('Validate::dateFormat', array('empty' => false, 'format' => 'm-d-Y g:i A'))->getFormatter('Format::datetime', array('from' => 'Y-m-d H:i:s', 'to' => 'm-d-Y g:i A'))->setFormatter('Format::datetime', array('from' => 'm-d-Y g:i A', 'to' => 'Y-m-d H:i:s')), Field::inst('registered_date')->validator('Validate::dateFormat', array('format' => 'j M Y H:i'))->getFormatter('Format::datetime', array('from' => 'Y-m-d H:i:s', 'to' => 'j M Y H:i'))->setFormatter('Format::datetime', array('from' => 'j M Y H:i', 'to' => 'Y-m-d H:i:s')))->process($_POST)->json();
开发者ID:FaTTeST,项目名称:billenv,代码行数:11,代码来源:datetime.php

示例13: function

<?php

/*
 * Example PHP implementation used for the index.html example
 */
// DataTables PHP library
include "../../php/DataTables.php";
// Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'audiobooks')->fields(Field::inst('title')->validator('Validate::notEmpty'), Field::inst('author')->validator('Validate::notEmpty'), Field::inst('duration')->validator('Validate::notEmpty'), Field::inst('readingOrder')->validator('Validate::numeric'))->on('preCreate', function ($editor, $values) {
    // On create update all the other records to make room for our new one
    $editor->db()->query('update', 'audiobooks')->set('readingOrder', 'readingOrder+1', false)->where('readingOrder', $values['readingOrder'], '>=')->exec();
})->on('postRemove', function ($editor, $id, $values) {
    // On remove, the sequence needs to be updated to decrement all rows
    // beyond the deleted row
    $editor->db()->query('update', 'audiobooks')->set('readingOrder', 'readingOrder-1', false)->where('readingOrder', $values['readingOrder'], '>')->exec();
})->process($_POST)->json();
开发者ID:FaTTeST,项目名称:billenv,代码行数:18,代码来源:sequence.php

示例14: userupdate

<?php

require_once Yii::app()->basePath . '/extensions/editor_datatables/php/DataTables.php';
//Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Upload, DataTables\Editor\Validate;
$user = Users::model()->findByPk(Yii::app()->user->id);
$client_id = $user->client_id;
function userupdate()
{
    $user_data = Users::model()->findByPk(Yii::app()->user->id);
    $step_completed = $user_data->step_completed;
    if ($user_data->user_role == 2 && $step_completed < 3) {
        $user_data->step_completed = 3;
        $user_data->save();
        //$this->redirect(Yii::app()->baseUrl.'/site/admin');
        $baseUrl = Yii::app()->baseUrl;
        //Yii::app()->request->redirect($baseUrl.'/site/admin');
        //echo "<script>window.location.href ='".$baseUrl."/site/admin';</script>";
        //return false;
    }
    //else{ $this->render('overview', ['user_data' => $user_data]); }
}
//Build our Editor instance and process the data coming from _POST
$time = date("fYhis");
// $extension = end(explode('.', Upload::DB_FILE_NAME));
Editor::inst($db, 'benchmark_components', 'id', $time, $client_id)->fields(Field::inst('benchmark_components.benchmark_id')->validator('Validate::notEmpty'), Field::inst('benchmark_components.instrument_id')->validator('Validate::notEmpty'), Field::inst('benchmark_components.is_instrument_or_portfolio'), Field::inst('benchmark_components.weight'), Field::inst('benchmarks.benchmark_name'), Field::inst('instruments.instrument'))->on('postCreate', function () {
    userupdate();
})->leftJoin('benchmarks', 'benchmarks.id', '=', 'benchmark_components.benchmark_id')->leftJoin('instruments', 'instruments.id', '=', 'benchmark_components.instrument_id')->where('benchmarks.client_id', $client_id)->process($_POST)->json();
开发者ID:artmart,项目名称:verare,代码行数:28,代码来源:benchmark_components.php

示例15:

<?php

require_once Yii::app()->basePath . '/extensions/editor_datatables/php/DataTables.php';
//Alias Editor classes so they are easy to use
use DataTables\Editor, DataTables\Editor\Field, DataTables\Editor\Format, DataTables\Editor\Join, DataTables\Editor\Upload, DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst($db, 'instruments', 'instruments.id')->fields(Field::inst('instrument_types.instrument_type'), Field::inst('instrument_groups.group_name'), Field::inst('instruments.id as id'), Field::inst('instruments.instrument as instrument'), Field::inst('instruments.instrument_type_id'), Field::inst('instruments.is_current'), Field::inst('instruments.created_at'), Field::inst('instruments.isin'), Field::inst('instruments.instrument_group_id'), Field::inst('instruments.currency'))->leftJoin('instrument_types', 'instrument_types.id', '=', 'instruments.instrument_type_id')->leftJoin('instrument_groups', 'instrument_groups.id', '=', 'instruments.instrument_group_id')->process($_POST)->json();
开发者ID:artmart,项目名称:verare,代码行数:7,代码来源:instruments.php


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