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


PHP Files::result方法代码示例

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


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

示例1: folder_contents

 /**
  * Get all folders and files within a folder
  *
  * @param   int     $parent The id of this folder
  * @return  array
  *
  **/
 public static function folder_contents($parent = 0, $type = null)
 {
     // they can also pass a url hash such as #foo/bar/some-other-folder-slug
     if (!is_numeric($parent)) {
         $segment = explode('/', trim($parent, '/#'));
         $result = ci()->file_folders_m->get_by('slug', array_pop($segment));
         $parent = $result ? $result->id : 0;
     }
     $folders = ci()->file_folders_m->where('parent_id', $parent)->where('hidden', 0)->order_by('sort')->get_all();
     // $files = ci()->file_m->where(array('folder_id' => $parent))
     //     ->order_by('sort')
     //     ->get_all();
     $files = ci()->file_m->where(array('folder_id' => $parent, 'type' => $type))->order_by('sort')->get_all();
     // let's be nice and add a date in that's formatted like the rest of the CMS
     if ($folders) {
         foreach ($folders as &$folder) {
             $folder->formatted_date = format_date($folder->date_added);
             $folder->file_count = ci()->file_m->count_by('folder_id', $folder->id);
         }
     }
     if ($files) {
         ci()->load->library('keywords/keywords');
         foreach ($files as &$file) {
             $file->keywords_hash = $file->keywords;
             $file->keywords = ci()->keywords->get_string($file->keywords);
             $file->formatted_date = format_date($file->date_added);
         }
     }
     return Files::result(true, null, null, array('folder' => $folders, 'file' => $files, 'parent_id' => $parent));
 }
开发者ID:jacksun101,项目名称:PyroAddons,代码行数:37,代码来源:imagepicker_m.php

示例2: save_alt

 /**
  * Edit the "alt" attribute of an image file
  */
 public function save_alt()
 {
     if ($id = $this->input->post('file_id') and $alt_attribute = $this->input->post('alt_attribute')) {
         $this->file_m->update($id, array('alt_attribute' => $alt_attribute));
         echo json_encode(Files::result(TRUE, lang('files:alt_saved')));
     }
 }
开发者ID:blekedeg,项目名称:lbhpers,代码行数:10,代码来源:admin.php

示例3: save_description

 /**
  * Edit description of a file
  */
 public function save_description()
 {
     if ($id = $this->input->post('file_id') and $description = $this->input->post('description')) {
         $this->file_m->update($id, array('description' => $description));
         echo json_encode(Files::result(TRUE, lang('files:description_saved')));
     }
 }
开发者ID:gamchantoi,项目名称:sisfo-ft,代码行数:10,代码来源:admin.php


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