public function getIndex() { $dbfolders = Folder::where('parent_id', \Input::get('id'))->get(); $folders = []; foreach ($dbfolders as $folder) { $foldername = $folder->name; if (strlen($foldername) > 20) { $filename = substr($foldername, 0, 20) . '...'; } array_push($folders, array('id' => $folder->id, 'name' => $foldername, 'fullname' => $folder->name, 'url' => $folder->name)); } $theme = "Admin"; return $this->View->make("FileManager::folder-template", compact("theme", 'folders')); }
public function getIndex() { $folder = Folder::find(\Input::get('id')); $dbfiles = $folder->Files; $files = []; foreach ($dbfiles as $file) { $filename = $file->name; if (strlen($filename) > 20) { $filename = substr($filename, 0, 15) . '...'; } array_push($files, array('id' => $file->id, 'name' => $filename, 'fullname' => $file->name, 'url' => asset('uploads') . '/' . $file->year . '/' . $file->month . '/' . $this->nameHandler($file->name, "180x130"), 'naturalSize' => asset('uploads') . '/' . $file->year . '/' . $file->month . '/' . $file->name, 'size' => $file->size)); } $theme = "Admin"; return $this->view->make("FileManager::file-template", compact("theme", 'files')); }