小编Mir*_*hid的帖子

如何在laravel中的控制器中获取url参数?

我的视图刀片.....

  tableHtml += "<td><a href= '{{url('/add')}}/" + data.hits[i].recipe.label + "'> add to favotite</a></td>";
Run Code Online (Sandbox Code Playgroud)

当我点击添加到收藏夹....我在网址中得到这个

HTTP://本地主机/百合/公/添加/辣椒%20Green%20Salad

///web.php

Route::get('/add', 'HomeController@add');
Run Code Online (Sandbox Code Playgroud)

////控制器......如何在控制器中获取url传递名称.....

public function add(Request $request)
{

$request->get("") ////////////how can i get the string i passed on url 

}
Run Code Online (Sandbox Code Playgroud)

php laravel

5
推荐指数
1
解决办法
9767
查看次数

React Native:依赖项的 AAR 元数据中指定的 minCompileSdk (31) 大于此模块的compileSdkVersion (android-30)

我正在使用 React Native:

npx react-native run-android
Run Code Online (Sandbox Code Playgroud)

我还有很多其他解决方案。比如强制或更新targetsdk版本并编译SDK版本,但没有任何效果。

我尝试将compileSdkVersion 30更改为compileSdkVersion 31,将targetSdkVersion 30更改为targetSdkVersion 31。

问题

依赖项的 AAR 元数据 (META-INF/com/android/build/gradle/aar-metadata.properties) 中指定的 minCompileSdk (31) 大于此模块的compileSdkVersion (android-30)。

Dependency: androidx.appcompat:appcompat:1.4.1.
Run Code Online (Sandbox Code Playgroud)

我的 build.gradle 文件

// Top-level build file where you can add configuration
// options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
        firebaseMessagingVersion = "21.1.0"
        googlePlayServicesVisionVersion = "19.0.0"
        playServicesVersion = "17.0.0" // or find latest version
        androidMapsUtilsVersion = "2.2.5"
        kotlin_version = …
Run Code Online (Sandbox Code Playgroud)

android react-native

4
推荐指数
1
解决办法
5164
查看次数

PDF文件未下载

我有以下内容file.php.我的PDF位于文件夹中file.php,并且其文件位于同一目录中.当我按下按钮时,PDF不是下载而是下载file.php.

<?php
  if (isset($_POST['file_name'])){
    $file= $_POST['file_name'];
    header('Content- type: application/pdf');
    header('Content-Disposition: attachament; filename: " .$files"');
    readfile('files/'.$file);
    exit(); 
  }
?>
<form action="file.php" method="POST" >
  <input name="file_name" value="cv.pdf" type="hidden">
  <input type="submit" value="Download CV">
</form>
Run Code Online (Sandbox Code Playgroud)

php pdf

0
推荐指数
1
解决办法
264
查看次数

标签 统计

php ×2

android ×1

laravel ×1

pdf ×1

react-native ×1