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


PHP ZendT_Lib::mapperViewToArrayUri方法代码示例

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


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

示例1: convertObjectToUri

 public static function convertObjectToUri($objectName)
 {
     $itens = ZendT_Lib::mapperViewToArrayUri($objectName);
     $uri = ZendT_Url::getHostName() . ZendT_Url::getBaseUrl() . '/' . $itens['module'] . '/' . $itens['controller'];
     return $uri;
 }
开发者ID:rtsantos,项目名称:mais,代码行数:6,代码来源:Lib.php

示例2: loadProfileFilter

 public function loadProfileFilter($fields, $params)
 {
     $this->enablejQueryValidate();
     $element = new ZendT_Form_Element_Hidden('_search');
     $element->setDecorators(array(new ZendT_Form_Decorator_Hidden()));
     $element->setValue('1');
     $this->addElement($element);
     if (count($fields)) {
         foreach ($fields as $field => $config) {
             if ($config['seeker']) {
                 $baseUri = $itens = ZendT_Lib::mapperViewToArrayUri($config['seeker']['mapperView']);
                 foreach ($config['seeker']['fields'] as $searchName => $searchProp) {
                     unset($config['seeker']['fields'][$searchName]);
                     break;
                 }
                 $element = new ZendT_Form_Element_Seeker($field);
                 $element->setSufix(str_replace('id_', '', $field));
                 $element->setIdField('id');
                 $element->setSearchField($searchName);
                 $element->setSearchAttribs($searchProp);
                 $element->modal()->setWidth(800);
                 $element->modal()->setHeight(400);
                 $element->url()->setGrid("/{$baseUri['module']}/{$baseUri['controller']}/grid");
                 $element->url()->setSearch("/{$baseUri['module']}/{$baseUri['controller']}/seeker-search");
                 $element->url()->setRetrive("/{$baseUri['module']}/{$baseUri['controller']}/retrive");
                 $element->url()->setAutoComplete("/{$baseUri['module']}/{$baseUri['controller']}/auto-complete");
                 //$element->enableAutoComplete();
                 if ($config['multiple'] !== '0') {
                     $element->setMultiple(true);
                 } else {
                     $element->setMultiple(false);
                 }
                 $element->setMapperView($config['seeker']['mapperView']);
                 //Procura os elementos que referenciam essa seeker, para criar uma dependência (filterRefer)
                 foreach ($fields as $field1 => $config1) {
                     if (isset($config1['seeker']) && isset($config1['seeker']['filter'])) {
                         $filterRefer = $config1['seeker']['filter'];
                         if ($filterRefer) {
                             foreach ($filterRefer as $filter1 => $key1) {
                                 if ($filter1 == $field) {
                                     $element->addFilterRefer($field1);
                                 }
                             }
                         }
                     }
                 }
                 $_where = $config['seeker']['where'];
                 $preFilter = $config['seeker']['filter'];
                 if ($_where && !$preFilter) {
                     $element->setWhere($_where);
                 } else {
                     if ($preFilter) {
                         /* print_r($config['seeker']);
                            exit; */
                         $dynamicWhere = "var where = new TWhere('AND');";
                         if ($_where) {
                             $whereFilters = $_where->getFilters();
                             foreach ($whereFilters as $i => $key) {
                                 $value = $key['value'];
                                 if (is_array($value)) {
                                     $value = $value[0];
                                 }
                                 $dynamicWhere .= "\n\t\t\t\t\t\t\t\t\twhere.addFilter({\n\t\t\t\t\t\t\t\t\t   field: '{$key['field']}',\n\t\t\t\t\t\t\t\t\t   value: '{$value}',\n\t\t\t\t\t\t\t\t\t   mapper: '{$key['mapper']}',\n\t\t\t\t\t\t\t\t\t   operation: '{$key['operation']}'\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t";
                             }
                         }
                         foreach ($preFilter as $filter => $key) {
                             if ($filter) {
                                 $label = $fields[$filter]['label'];
                                 $operation = !$key['operation'] ? 'in' : $key['operation'];
                                 $dynamicWhere .= "\n\t\t\t\t\t\t\t\t\t\tvar value1 = \$('#{$filter}').val();\n\t\t\t\t\t\t\t\t\t\tvar value2 = \$('#{$filter}-multiple').val();\n\t\t\t\t\t\t\t\t\t\tif(!value1 && !value2){\n\t\t\t\t\t\t\t\t\t\t\tvar searchid = \$('#{$field}').attr('searchid');\n\t\t\t\t\t\t\t\t\t\t\t\$('#group-' + searchid + ' input').val('');\n\t\t\t\t\t\t\t\t\t\t\talert('Favor preencher o campo {$label}!');\n\t\t\t\t\t\t\t\t\t\t\tvar searchid = \$('#{$filter}').attr('searchid');\n\t\t\t\t\t\t\t\t\t\t\t\$('#' + searchid).focus();\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar value = (value1?value1:value2);\n\t\t\t\t\t\t\t\t\t\tif(value.indexOf(';') != -1){\n\t\t\t\t\t\t\t\t\t\t\twhile(value.indexOf(';') != -1){\n\t\t\t\t\t\t\t\t\t\t\t\tvalue = value.replace(';',',');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t\t\t\t\t}\n\t \n\t\t\t\t\t\t\t\t\t\twhere.addFilter({\n\t\t\t\t\t\t\t\t\t\t   field: '{$key['field']}',\n\t\t\t\t\t\t\t\t\t\t   value: value,\n\t\t\t\t\t\t\t\t\t\t   mapper: '{$key['mapper']}',\n\t\t\t\t\t\t\t\t\t\t   operation: '{$operation}'\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t";
                             }
                         }
                         $dynamicWhere = "function(){ {$dynamicWhere} return where.toJson(); }";
                         #echo $preWhere;die;
                         $element->setOnFilter($dynamicWhere);
                     }
                 }
                 foreach ($config['seeker']['fields'] as $fieldName => $fieldProp) {
                     $element->addField($fieldName, $fieldName, 'text', $fieldProp);
                 }
             } else {
                 if ($config['autocomplete']) {
                     $element = new ZendT_Form_Element_AutoComplete($field);
                     $url = ZendT_Url::getUri(true) . '/auto-complete/suggest/1/column/' . $field . '/profile/' . $params['profile'];
                     $element->setDataSource($url);
                     $extraParams = array('filters' => new ZendT_JS_Command("function(){\n\t\t\t\t\t\t\tvar formData = jQuery('#" . $this->getId() . "').serializeArray();\n\t\t\t\t\t\t\tvar data = '';\n\t\t\t\t\t\t\tfor(var index in formData){\n\t\t\t\t\t\t\t\tdata = data + '&' + formData[index].name + '=' + formData[index].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn data.substr(1);\n\t\t\t\t\t\t}"));
                     $element->setJQueryParam('limit', 100);
                     $element->setJQueryParam('extraParams', $extraParams);
                     $element->setJQueryParam('showButtonSearch', true);
                     if ($config['multiple'] !== '0') {
                         $element->setJQueryParam('multiple', true);
                     } else {
                         $element->setJQueryParam('multiple', false);
                     }
                     $element->setJQueryParam('multipleSeparator', ';');
                     $element->setJQueryParam('mustMatch', true);
                     $element->setJQueryParam('autoFill', true);
                 } else {
                     if (in_array($config['type'], array('Date', 'DateTime'))) {
                         if (getBrowser() != 'IE 8.0') {
//.........这里部分代码省略.........
开发者ID:rtsantos,项目名称:mais,代码行数:101,代码来源:Form.php


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