我试图将一些php文件放入我的主var autocompleteTimer = null;
var ingredientSuggestions = ko.observableArray();
var selectedSuggestion = ko.observable();
var nameFocused = ko.observable();
var suggestionsAvailable = ko.observable(false);
var showSuggestions = ko.computed(() => nameFocused() && suggestionsAvailable());
(...)
var suggestionsReceived = function(suggestions) {
var newSuggestions = new IngredientSuggestions(suggestions);
ingredientSuggestions(newSuggestions.suggestions);
suggestionsAvailable(ingredientSuggestions().length > 0);
};
var requestSuggestions = function () {
autocompleteTimer = null;
recipeService.getIngredientSuggestions(name(), suggestionsReceived, null);
};
var nameChanged = function (newValue) {
if (autocompleteTimer != null) {
clearTimeout(autocompleteTimer);
}
autocompleteTimer = setTimeout(requestSuggestions, 500);
};
但我收到以下错误:
警告:require(/opt/lampp/htdocs/steamauth/userinfo.php):失败了 open stream:/opt/lampp/htdocs/index.php中没有这样的文件或目录 第4行
致命错误:require():需要打开失败 '/opt/lampp/htdocs/steamauth/userinfo.php' (include_path ='/ opt / lampp / htdocs /')在/opt/lampp/htdocs/index.php上 第4行
我尝试添加以下代码:
index.php
我的包含文件steamauth.php和userinfo.php位于/ opt / lampp / htdocs / steamauth /
我还尝试在set_include_path('/opt/lampp/htdocs/');
require dirname(__FILE__).'/steamauth/steamauth.php';
文件中设置include_path,并将其添加到我的php.ini
文件中。是的,我确信这是我想要包含的正确路径。有什么想法吗?
答案 0 :(得分:0)
您的项目文件夹结构是什么?简单地说,尝试从index.php获取路径。
NativeModules[this.props.fragmentOrActivityHash].showToast("It works")
答案 1 :(得分:0)
我在尝试将新目录添加到php路径时遇到了同样的问题。我解决了在php.ini文件中添加双引号围绕include_path的问题。 像这样:
include_path="C:\xampp\php\PEAR;c:\xampp\smarty\smarty-3.1.30\libs";