Last active
August 29, 2015 14:07
-
-
Save DB-009/87a793f79787aec37fb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($noajax==1) | |
@extends('layouts.master') | |
@endif | |
@section('content') | |
//controller | |
public function test($id,$model) | |
{ | |
if (Request::ajax()) | |
{ | |
//$foreign_key and $model must be <> null | |
if ($id == null || $model == null) { | |
$this->render('../Errors/missing_arg', 'error'); | |
return; | |
} | |
if($model=="ArtObj") | |
{ | |
$partable = "art_objects"; | |
$path='img/art-objects/'; | |
} | |
$parid=$id; | |
$noajax=0; | |
$mediaimgs = Media::where('parent_id' , $id )->where('parent_table', $partable)->paginate(15); | |
$response = Response::Json($mediaimgs); | |
return View::make('/Admin/manageimage/manage_image',compact('parid','mediaimgs','model','path','noajax')); | |
} | |
else{ | |
if($model=="ArtObj") | |
{ | |
$partable = "art_objects"; | |
$path='img/art-objects/'; | |
} | |
$parid=$id; | |
$mediaimgs = Media::where('parent_id' , $id )->where('parent_table', $partable)->paginate(15); | |
$response = Response::Json($mediaimgs); | |
$noajax = 1; | |
return View::make('/Admin/manageimage/manage_image',compact('parid','mediaimgs','model','path','noajax')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment