當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HC_Lib::generate_rand方法代碼示例

本文整理匯總了PHP中HC_Lib::generate_rand方法的典型用法代碼示例。如果您正苦於以下問題:PHP HC_Lib::generate_rand方法的具體用法?PHP HC_Lib::generate_rand怎麽用?PHP HC_Lib::generate_rand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HC_Lib的用法示例。


在下文中一共展示了HC_Lib::generate_rand方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct($name = '')
 {
     if (!strlen($name)) {
         $name = 'nts_' . HC_Lib::generate_rand();
     }
     $this->set_name($name);
 }
開發者ID:kumarkvk,項目名稱:vz_emp_shiftsSchedule,代碼行數:7,代碼來源:basic.php

示例2: array

<?php

$link = HC_Lib::link('shift_groups/bulk');
$display_form = HC_Html_Factory::widget('form')->add_attr('action', $link->url());
$display_form->add_item($form->input('action'));
$btn_bar = HC_Html_Factory::widget('list')->add_attr('class', 'list-inline')->add_attr('class', 'list-separated');
$my_id = 'hc_actions_' . HC_Lib::generate_rand();
if ($act_on_all) {
    $ids_input = $form->input('ids')->set_value(join('|', $ids));
    $display_form->add_item($ids_input);
    $btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-toggle')->add_attr('data-target', '#' . $my_id)->add_child(HC_Html::icon('cog') . HCM::__('With All')));
} else {
    $btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-all-checker')->add_attr('data-collect', 'id')->add_child(HC_Html::icon('check') . HCM::__('Select All')));
    $btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-toggle')->add_attr('data-target', '#' . $my_id)->add_child(HC_Html::icon('cog') . HCM::__('With Selected')));
}
/* ACTION OPTIONS */
$shift = HC_App::model('shift');
$actions = HC_Html_Factory::widget('list')->add_attr('class', 'list-unstyled')->add_attr('class', 'list-separated')->add_attr('id', $my_id)->add_attr('style', 'display: none;');
/* NEW EDIT */
$edit_actions = HC_Html_Factory::widget('list')->add_attr('class', 'list-unstyled')->add_attr('class', 'list-separated');
/* NEW EDIT - STATUS */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('Status'))->set_content($form->input('status')->set_holder(HC_Html_Factory::widget('list')->add_attr('class', array('list-unstyled'))->add_attr('class', array('list-separated')))->add_option(SHIFT_HC_MODEL::STATUS_DRAFT, $shift->set('status', SHIFT_HC_MODEL::STATUS_DRAFT)->present_status())->add_option(SHIFT_HC_MODEL::STATUS_ACTIVE, $shift->set('status', SHIFT_HC_MODEL::STATUS_ACTIVE)->present_status())->set_default(SHIFT_HC_MODEL::STATUS_DRAFT)->add_attr('disabled', 'disabled')));
/* NEW EDIT - START TIME */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('Start Time'))->set_content($form->input('start')->add_attr('disabled', 'disabled')));
/* NEW EDIT - END TIME */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('End Time'))->set_content($form->input('end')->add_attr('disabled', 'disabled')));
/* SOME JS TO DISABLE HIDDEN INPUTS */
$fid = $display_form->id();
$addon = array();
$addon[] = '<script language="JavaScript">';
$addon[] = <<<EOT
開發者ID:RCMmedia,項目名稱:rubicon,代碼行數:31,代碼來源:form.php


注:本文中的HC_Lib::generate_rand方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。