How can id display from asset library?
Permalink
Good morning. Please anyone can help.
Block add or edit.php
<?php $al = Loader::helper('concrete/asset_library');
echo $al->file('thumbnail', 'thumbnailFileID', 'Select Thumbnail');
$thumbID = ?
echo $thumbID; ? how the file id can display ? etc id:33
?>
John
Block add or edit.php
<?php $al = Loader::helper('concrete/asset_library');
echo $al->file('thumbnail', 'thumbnailFileID', 'Select Thumbnail');
$thumbID = ?
echo $thumbID; ? how the file id can display ? etc id:33
?>
John
$("#thumbnail-fm-value").val() that can output id number from assest but how the javascript val gets onto php variable??
Any help would be most appreciated.
Have a look at the code in the list files from set addon.
http://www.concrete5.org/marketplace/addons/list-files-from-set/...
http://www.concrete5.org/marketplace/addons/list-files-from-set/...
Thanks John but I was trying to different way.
Controller.php
public function thumbnail(){
$al = Loader::helper('concrete/asset_library');
$myThumbnail_a = $al->file('thumbnail', 'thumbnailFileID', 'Select Thumbnail');
$myThumbnail_b = File::getByID($thumbnail);
$myThumbnail_c = $myThumbnail_b->getVersion()->getRelativePath();
$thumb_post = $_POST['thumbnailFileID'];
return $myThumbnail_a;
}
edit.php
echo $controller->thumbnail();
I want to output two variable of $myThumbail_c and $thumb_post at edit.php. I think use array. Please give me for example.
Thanks
Controller.php
public function thumbnail(){
$al = Loader::helper('concrete/asset_library');
$myThumbnail_a = $al->file('thumbnail', 'thumbnailFileID', 'Select Thumbnail');
$myThumbnail_b = File::getByID($thumbnail);
$myThumbnail_c = $myThumbnail_b->getVersion()->getRelativePath();
$thumb_post = $_POST['thumbnailFileID'];
return $myThumbnail_a;
}
edit.php
echo $controller->thumbnail();
I want to output two variable of $myThumbail_c and $thumb_post at edit.php. I think use array. Please give me for example.
Thanks
I am sorry, I can't follow what you are trying to do.
Sorry I am no good English. Is it possible to return multiple values from a function?
You can put the values into a keyed array, then return the array and access the values from their array keys.
You can also do a similar thing by creating and returning an object, then accessing the values object properties.
return array('variable1' => $variable1, 'variable2' => $variable2);
You can also do a similar thing by creating and returning an object, then accessing the values object properties.