本文整理汇总了PHP中Doo::loadHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Doo::loadHelper方法的具体用法?PHP Doo::loadHelper怎么用?PHP Doo::loadHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doo
的用法示例。
在下文中一共展示了Doo::loadHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modPassword
public function modPassword()
{
$userInfo = $this->_user->getUserInfo();
//D($userInfo);
$uid = $userInfo['uid'];
if ($uid == 0 && isset($uid)) {
$this->alert('参数错误');
return;
}
if ($this->isAjax() && $_POST) {
$v = Doo::loadHelper('DooValidator', true);
$success = true;
$errors = array();
$password = $_POST['password'];
$password1 = $_POST['password1'];
$password2 = $_POST['password2'];
$pwd = $this->_user->password($password);
//md5(KEY_PASSWORD.$password);
if ($userInfo['passwd'] != $pwd) {
$success = false;
$errors[] = '密码不正确';
}
if (!isset($password1)) {
$success = false;
$errors[] = '新登陆密码不能为空';
}
if (!isset($password2)) {
$success = false;
$errors[] = '再次输入密码不能为空';
}
if ($password1 != $password2) {
$success = false;
$errors[] = '两次输入的密码不一致,请检查';
}
// 插入数据库(接口没有验证数据是否重复,需添加者自己注意)
if ($success) {
$result = $this->_user->update_pwd(1, $uid, $password1);
if (isset($result) && $result != 0) {
$success = false;
$errors[] = '插入数据库出错,不可连续修改两次密码且不可与原密码相同';
}
}
// 处理返回路径
if ($success) {
if (isset($_POST['saveAndReutrn'])) {
$errors = Doo::conf()->APP_URL . 'index.php/in';
}
}
// 处理表单位提交
$this->ajaxFormResult($success, $errors, true, 'loginOut');
} else {
//取某用户信息
$row = $this->_user->get_one($uid);
//D($row);
// 显示生成表单
Doo::loadClassAt('html/DooFormExt', 'default');
$form = new DooFormExt($this->_getPasswordFormConfig(false, $row));
$this->contentlayoutRender($form->render());
}
}
示例2: mod
public function mod()
{
$configKey = 'settingConfig';
// $cachePath = Doo::conf()->CACHE_PATH;
// Doo::conf()->CACHE_PATH = Doo::conf()->SITE_PATH.'protect/confCache/';
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.config.js');
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.all.min.js');
array_push($this->_includeJsFileList, 'js/ueditor/lang/zh-cn/zh-cn.js');
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.use.js');
$shopNameList = DBproxy::getProcedure('Manage')->setDimension(2)->getShopName();
$shopNameOpt = '<select class="m-wrap" name="shopname" id="city-element">';
foreach ($shopNameList as $key => $value) {
$selected = $this->getUrlVar('shopname') == $value['cityid'] . ',' . $value['shopname'] ? 'selected=selected' : '';
$shopNameOpt .= '<option ' . $selected . ' value="' . $value['cityid'] . ',' . $value['shopname'] . '">' . $value['cityNshopname'] . '</option>';
}
$shopNameOpt .= '</select>';
if ($this->isAjax() && $_POST) {
$v = Doo::loadHelper('DooValidator', true);
$success = true;
$errors = array();
DOO::cache('php')->set($configKey, json_encode($_POST), 3600 * 24 * 365 * 100);
// 处理返回路径
if ($success) {
$errors = ConfigController::$dataTableUrl;
}
$this->ajaxFormResult($success, $errors);
} else {
$infoCache = DOO::cache('php')->get($configKey);
$info = json_decode($infoCache, true);
// echo Doo::conf()->CACHE_PATH = $cachePath;
Doo::loadClassAt('html/DooFormExt', 'default');
$form = new DooFormExt(array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label' => false, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'peiSwitch' => array('select', array('label' => L('菜品调剂发送开关:'), 'attributes' => array('class' => "m-wrap"), 'multioptions' => array(0 => '关', 1 => '开'), 'value' => isset($info['peiSwitch']) ? $info['peiSwitch'] : '0')), 'waimaiSum' => array('text', array('label' => '外卖起送份数', 'attributes' => array('class' => "m-wrap"), 'value' => isset($info['waimaiSum']) ? $info['waimaiSum'] : '1')), 'aboutTxt' => array('display', array('label' => '关于我们', 'attributes' => array('class' => "m-wrap"), 'content' => '<script id="about" type="text/plain" style="width:1024px;height:500px;">' . $info['editorValue'] . '</script>')), 'saveAndSee' => array('button', array('div' => false, 'left' => ' ', 'label' => '保存&查看<i class="icon-arrow-right"></i>', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancelAndReturn' => array('display', array('div' => false, 'left' => ' ', 'right' => '</div>', 'content' => '<a class="btn" href="' . ConfigController::$dataTableUrl . '"><i class="icon-arrow-left"></i>取消&返回</a>')))));
$this->contentlayoutRender($form->render());
}
}
示例3: table
private function table()
{
Doo::loadHelper('DooFile');
$id = Lua::get('id');
$db = $this->_get($id);
$list = $this->_tree($id);
include Lua::display('table', $this->dir);
}
示例4: validate
public function validate($checkMode = 'all', $requireMode = 'null')
{
//You do not need this if you extend DooModel or DooSmartModel
//MODE: all, all_one, skip
Doo::loadHelper('DooValidator');
$v = new DooValidator();
$v->checkMode = $checkMode;
$v->requiredMode = $requireMode;
return $v->validate(get_object_vars($this), $this->getVRules());
}
示例5: __construct
public function __construct()
{
Doo::loadHelper('DooFile');
$this->fileManager = new DooFile(0777);
$this->defaultRootViewPath = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER . 'view/';
$this->rootViewPath = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER . 'view/';
$this->rootCompiledPath = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER . 'viewc/';
if (self::$uniqueId == 0) {
self::$uniqueId = time();
}
}
示例6: url2
function url2($addRootUrl, $controller, $method, $param = null)
{
Doo::loadHelper('DooUrlBuilder');
// param pass in as string with format
// 'param1=>this_is_my_value, param2=>something_here'
if ($param != null) {
$param = explode(', ', $param);
$param2 = null;
foreach ($param as $p) {
$splited = explode('=>', $p);
$param2[$splited[0]] = $splited[1];
}
return DooUrlBuilder::url2($controller, $method, $param2, $addRootUrl);
}
return DooUrlBuilder::url2($controller, $method, null, $addRootUrl);
}
示例7: home
private function home()
{
Doo::loadHelper('DooFile');
$f = new DooFile();
$list = $f->getList($this->plugin_dir, DooFile::LIST_FOLDER);
$ps = array();
if ($list) {
foreach ($list as $k => $v) {
$rs['name'] = $f->readFileContents($v['path'] . '/readme.txt');
$rs['ico'] = '/' . ADMIN_ROOT . '/' . Doo::conf()->PROTECTED_FOLDER . 'plugin/' . $v['name'] . '/ico.png';
$rs['act'] = $v['name'];
$ps[$v['name']] = $rs;
}
}
include Lua::display('plugin', $this->dir);
}
示例8: twitter_follower
public function twitter_follower()
{
Doo::loadHelper('DooRestClient');
$client = new DooRestClient();
// Check out this Twitter API http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-trends-daily
$client->connect_to('http://twitter.com/followers/ids/doophp.xml')->get();
if ($client->isSuccess()) {
$data['title'] = 'Twitter Followers\' Id <em>http://twitter.com/followers/ids/doophp.xml</em>';
$data['content'] = '<br/>HTTP result code: ' . $client->resultCode() . '<br/>Received content-type: ' . $client->resultContentType();
$data['content'] .= '<br/><br/>XML string: <pre>' . htmlentities($client->result()) . '</pre>';
$data['baseurl'] = Doo::conf()->APP_URL;
$data['printr'] = $client->xml_result();
} else {
print_r($client->resultCode());
print_r($client->result());
echo 'Failed to get Twitter API!';
exit;
}
$this->view()->render('template', $data);
}
示例9: __add
public function __add()
{
if ($this->isAjax() && $_POST) {
$v = Doo::loadHelper('DooValidator', true);
$success = true;
$errors = array();
$rules = $this->_getFormRule();
// 验证数据
if ($errors = $v->validate($_POST, $rules)) {
$success = false;
}
//数据处理
$param['name'] = trim($_POST['name']);
$param['city'] = trim($_POST['city']);
$param['longitude'] = intval($_POST['longitude']);
$param['latitude'] = intval($_POST['latitude']);
$param['status'] = intval($_POST['status']);
$res = DBproxy::getProcedure('Manage')->setDimension(2)->mapIU('i', $param);
if ($res['status'] != 0) {
$success = false;
$errors[] = '添加DB异常!';
}
// 处理返回路径
if ($success) {
if (isset($_POST['saveAndReutrn'])) {
$errors = UserController::$dataTableUrl;
} else {
$errors = UserController::$addUrl;
}
}
// 处理表单位提交
$this->ajaxFormResult($success, $errors);
} else {
// 显示生成表单
Doo::loadClassAt('html/DooFormExt', 'default');
$form = new DooFormExt($this->_getFormConfig(true));
$btn = '<a class="btn green-stripe" href="' . UserController::$dataTableUrl . '"><i class="icon-backward"> </i>门店列表</a>';
// 显示模版
$this->contentlayoutRender($btn . $form->render());
}
}
示例10: getMovies
public function getMovies()
{
Doo::loadClass('Movie');
$this->dbapi = new Movie();
Doo::loadHelper('DooPager');
$mtype = $this->ppv_cat_code;
if ($_POST['mtype'] == 'svod') {
$mtype = $this->svod_cat_code;
}
$pager = new DooPager(Doo::conf()->APP_URL . "ajax/movie", count($this->dbapi->get_movie_by_id($mtype)), 10, 10);
if (isset($this->params['page'])) {
$pager->paginate(intval($this->params['page']));
} else {
$pager->paginate(1);
}
$data['pager'] = $pager->output;
list($start, $limit) = explode(',', $pager->limit);
$movies = $this->dbapi->get_movie_by_id($mtype, (int) $start, (int) $limit, $orderby, $order);
$this->setContentType('json');
echo json_encode($movies);
}
示例11: init
function init()
{
Doo::loadHelper('DooTextHelper');
$usession = $this->usession;
if (isset($_POST['table_row'])) {
$usession->uset('table_row_option', $_POST['table_row']);
}
$rows_data = $usession->uget('table_row_option');
$data['limit'] = 20;
if ($rows_data) {
$data['limit'] = $rows_data;
}
$gpage = $_GET['page'] - 1;
$gsearch = addslashes($_POST['search']);
$gdtform = addslashes($_GET['dtform']);
$gdtto = addslashes($_GET['dtto']);
if (!$gdtform) {
$gdtform = date("m/d/Y", strtotime("-1 week"));
}
if (!$gdtto) {
$gdtto = date("m/d/Y");
}
$data['gdtto'] = $gdtto;
$data['gdtform'] = $gdtform;
$start_date = $gdtform = date("Y-m-d H:i:s", strtotime($gdtform));
$end_date = $gdtto = date("Y-m-d", strtotime($gdtto)) . " 23:59:59";
if (isset($gpage) && $gpage >= 0) {
$start = $gpage * $data['limit'];
}
$this->limit = $data['limit'];
$this->start = $start;
$this->start_date = $start_date;
$this->end_date = $end_date;
$this->gsearch = $gsearch;
$this->gdtto = $data['gdtto'];
$this->gdtform = $data['gdtform'];
}
示例12: _validate
/**
* Validate the Model with the rules defined in getVRules()
*
* @param object $model Model object to be validated.
* @param string $checkMode Validation mode. all, all_one, skip
* @param string $requireMode Require Check Mode. null, nullempty
* @return array Return array of errors if exists. Return null if data passes the validation rules.
*/
public static function _validate($model, $checkMode = 'all', $requireMode = 'null')
{
//all, all_one, skip
Doo::loadHelper('DooValidator');
$v = new DooValidator();
$v->checkMode = $checkMode;
$v->requiredMode = $requireMode;
return $v->validate(get_object_vars($model), $model->getVRules());
}
示例13: genPgSQL
public static function genPgSQL($path = null)
{
if ($path === null) {
$path = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER . 'model/';
}
Doo::loadHelper('DooFile');
$fileManager = new DooFile(0777);
$dbconf = Doo::db()->getDefaultDbConfig();
$dbSchema = $dbconf[6];
$dbname = $dbconf[1];
echo "<html><head><title>DooPHP Model Generator - DB: {$dbname}</title></head><body bgcolor=\"#2e3436\">";
$smt = Doo::db()->query("SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = '{$dbSchema}'");
$tables = $smt->fetchAll();
foreach ($tables as $tbl) {
$tblname = $tbl["name"];
//tablename
//Get table description
$smt2 = Doo::db()->query("SELECT DISTINCT column_name AS name, data_type AS type, is_nullable AS null,\n column_default AS default, ordinal_position AS position, character_maximum_length AS char_length,\n character_octet_length AS oct_length FROM information_schema.columns\n WHERE table_name = '{$tblname}' AND table_schema = '{$dbSchema}' ORDER BY position");
$fields = $smt2->fetchAll();
//Get primary key
$smt3 = Doo::db()->query("SELECT relname, indkey\n FROM pg_class, pg_index\n WHERE pg_class.oid = pg_index.indexrelid\n AND pg_class.oid IN (\n SELECT indexrelid\n FROM pg_index, pg_class\n WHERE pg_class.relname='{$tblname}'\n AND pg_class.oid=pg_index.indrelid\n AND indisprimary = 't')");
//indkey
$fields3 = $smt3->fetchAll();
$smt4 = Doo::db()->query("SELECT t.relname, a.attname, a.attnum\n FROM pg_index c\n LEFT JOIN pg_class t\n ON c.indrelid = t.oid\n LEFT JOIN pg_attribute a\n ON a.attrelid = t.oid\n AND a.attnum = ANY(indkey)\n WHERE t.relname = '{$tblname}'\n AND a.attnum = {$fields3[0]['indkey']}");
$fields4 = $smt4->fetchAll();
$pkey = $fields4[0]['attname'];
//Prepare model class
$classname = '';
$temptbl = $tblname;
for ($i = 0; $i < strlen($temptbl); $i++) {
if ($i == 0) {
$classname .= strtoupper($temptbl[0]);
} else {
if ($temptbl[$i] == '_' || $temptbl[$i] == '-' || $temptbl[$i] == '.') {
$classname .= strtoupper($temptbl[$i + 1]);
$arr = str_split($temptbl);
array_splice($arr, $i, 1);
$temptbl = implode('', $arr);
} else {
$classname .= $temptbl[$i];
}
}
}
$filestr = "<?php\nclass {$classname}{\n";
$fieldnames = array();
foreach ($fields as $f) {
$filestr .= " public \${$f['name']};\n";
$fieldnames[] = $f['name'];
}
$fieldnames = implode($fieldnames, "','");
$filestr .= " public \$_table = '{$tblname}';\n";
$filestr .= " public \$_primarykey = '{$pkey}';\n";
$filestr .= " public \$_fields = array('{$fieldnames}');\n";
$filestr .= "}\n?>";
if ($fileManager->create($path . "{$classname}.php", $filestr, 'w+')) {
echo "<span style=\"font-size:190%;font-family: 'Courier New', Courier, monospace;\"><span style=\"color:#fff;\">Model for table </span><strong><span style=\"color:#e7c118;\">{$tblname}</span></strong><span style=\"color:#fff;\"> generated. File - </span><strong><span style=\"color:#729fbe;\">{$classname}</span></strong><span style=\"color:#fff;\">.php</span></span><br/><br/>";
} else {
echo "<span style=\"font-size:190%;font-family: 'Courier New', Courier, monospace;\"><span style=\"color:#f00;\">Model for table </span><strong><span style=\"color:#e7c118;\">{$tblname}</span></strong><span style=\"color:#f00;\"> could not be generated. File - </span><strong><span style=\"color:#729fbe;\">{$classname}</span></strong><span style=\"color:#f00;\">.php</span></span><br/><br/>";
}
}
$total = sizeof($tables);
echo "<span style=\"font-size:190%;font-family: 'Courier New', Courier, monospace;color:#fff;\">Total {$total} file(s) generated.</span></body></html>";
}
示例14: helper
/**
* short hand of Doo::loadHelper()
* @param string $class_name
* @param bool $createObj
* @return mixed If $createObj is True, it returns the created Object
*/
public function helper($class_name, $createObj = false)
{
return Doo::loadHelper($class_name, $createObj);
}
示例15: indexKoreanpackage
public function indexKoreanpackage()
{
Doo::loadHelper('DooPager');
Doo::loadClass('Movie');
$mv = new Movie();
$data = $this->conf_data;
$data['title'] = 'UseeTV - Korean Packet';
$data['content_view'] = 'content/new_svod.php';
if (!$this->start) {
$this->start = 0;
}
$data['limit'] = $this->limit;
$data['gdtto'] = $this->gdtto;
$data['gdtform'] = $this->gdtform;
$data['content_data'] = $mv->get_korean_register($_GET['userProvider'], $_REQUEST['speedyRegional'], $_REQUEST['speedySubRegional'], $this->start_date, $this->end_date, $this->start, $data['limit'], $this->ord, $this->gsearch);
if ($_REQUEST['print'] == 'excel') {
DooTextHelper::download_send_headers('koreanpackage_' . date("Ymd") . ".csv");
echo DooTextHelper::array2csv($data['content_data']);
exit;
}
$data['total'] = $mv->get_total_from_query();
$data['graph'] = $mv->get_graph_korean_register($_GET['userProvider'], $_REQUEST['speedyRegional'], $_REQUEST['speedySubRegional'], $this->start_date, $this->end_date);
$data['filter_action'] = 'koreanpackage';
$data['table_row_option'] = array(20, 100, 500, 1000, 10000);
$data['label'] = 'KOREAN PACKAGE';
$this->view()->renderc(Doo::conf()->language . '/t3', $data);
}