Magento 2: Controller issue

I have code in the controller eg: if($token==”) { echo ‘token not found’; exit; } else { echo $lead; exit; } But need to return this public function execute() { if(isset($getCookie)){ $lead = $this->api->getleadDataForm(‘COOKIE’, $getCookie,$allfield); $token=$this->api->getToken(); } if($token==”) { $response = ‘token not found’; } else { $response = $lead; } return $response; } But…

Image is not saving when upload it from custom frontend phtml file

Image is not saving when upload it from custom frontend phtml file Here is my Controller $path = Mage::getBaseDir(‘media’) . ‘/pres’; if (!file_exists($path)) { mkdir($path, 777, true); } if ($_FILES[‘bms_file’][‘name’] != ”) { $fname = date(‘dmYHis’).$_FILES[‘bms_file’][‘name’]; $uploader = new Varien_File_Uploader(‘bms_file’); $uploader->setAllowedExtensions(array(‘png’, ‘jpg’, ‘jpeg’, ‘docx’, ‘pdf’)); $uploader->setAllowCreateFolders(true); $uploader->setAllowRenameFiles(false); $uploader->setFilesDispersion(false); $uploader->save($path, $fname); $filen=$uploader->getUploadedFileName(); $data[‘bms_file’] = $filen; }

Magento 2:Uncaught TypeError: $(…).slick is not a function Slick slider

File: gallery.phtml Path: Magento/module-catalog/view/frontend/templates/product/view/gallery.phtml <link rel=”stylesheet” type=”text/css” href=”https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css”> <link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css”> <?php $someJSON = $block->getGalleryImagesJson(); $someArray = json_decode($someJSON, true); ?> <div class=”container”> <div class=”row”> <div class=”col-sm-8″> <div class=”videos-slider-2″> <div> <?php foreach ($someArray as $value => $key){ ?> <div class=”bs-overlay”> <img src=”<?= /* @noEscape */ $key[‘full’] ?>” alt=”” /> </div> <?php }?> </div> </div> <div class=”slider-nav-thumbnails”>…