如何获取帖子变量的数据?就像我使用post方法发布表单然后我可以使用$ _REQUEST或$ _POST获取它.我怎么能在mgento做到这一点?
当我尝试构建 docker 应用程序时,出现以下错误。我正在运行的命令是docker build -t node_curd_exe .
error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=h3q9gxeprezyco28agiqe9jp2&shmsize=0&t=node_curd_exe&target=&ulimits=null&version=1: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
我还能做什么?
我正在使用具有表单的 React 功能组件。我创建了一个表单处理程序,它触发并onSuccess关闭模型。onFailureonSuccess
现在我需要为、函数和模式结束语句编写测试。onFailureonSuccess
组件的代码是:
export const TestUpdateModal = function( props ) {
const onSuccess = () => {
MiModal.close( 'AccUpdate' );
}
const onFailure = ( message ) => {
// show error message
}
const { handleSubmit } = updateFormHandler({
onSuccess: onSuccess,
onFailure: onFailure
});
return <form onSubmit={ e => handleSubmit( e ) }/>
}
----------------------------
updateFormHandler is
import { useMutation } from '@apollo/react-hooks';
import UpdateProfile_MUTATION from '../../../graphql/mutations/updateProfile/updateProfile';
export const updateFormHandler …Run Code Online (Sandbox Code Playgroud) 我已经在magento中创建了自定义模块,我想使用jquery ajax访问控制器,但我找不到正确的方法来执行此操作.
模板中的Ajax代码是
jQuery(".deleteAttrKeyId").on("click",function(){
var baseUrl="<?php echo Mage::getBaseUrl();?>";
var idArr=this.id.split("-");
attrKeyId=idArr[1];
alert(this.id);
jQuery.ajax({
type: "POST",
dataType: "JSON",
data :{'id':attrKeyId},
url :baseUrl+"groupprice/adminhtml_grouppricebackend/index",
complete:function(){alert("completed");
},
success:function(result){
alert(result);
}
});
});
Run Code Online (Sandbox Code Playgroud)
布局中的块代码是
<groupprice_adminhtml_grouppricebackend_index>
<reference name="content">
<block type="groupprice/adminhtml_grouppricebackend" name="grouppricebackend" template="groupprice/grouppricebackend.phtml"/>
</reference>
</groupprice_adminhtml_grouppricebackend_index>
Run Code Online (Sandbox Code Playgroud)
控制器代码是
<?php
class Group_GroupPrice_Adminhtml_GrouppricebackendController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
echo __FILE__;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用magento管理面板,我想在模板路径上就像我们为前端做的那样,我通过安装扩展来尝试它,但它不起作用.请让我知道我该怎么做?
Angular js在市场上是新的,所以使用带有magento的角度js有什么优势 吗?
如果是,那么任何人都知道我们如何在一个项目中同时使用它们?
我想在es6中构造对象,但没有得到结果。
let animal ={
data:{
typee:{
title: "Cow",
legs:4
}
}
}
let {data:{typee:{title,legs}}}=animal;
Run Code Online (Sandbox Code Playgroud)
现在console.log(data)输出Error: data is not defined。我做错了什么?
renderHook我在测试用例中使用时遇到此错误。不确定是什么问题。
TypeError: (0 , _reactTestRenderer.act) is not a function
13 |
14 | it('allows to upload photos through the mutation', async () => {
> 15 | const { result, nextUpdate } = renderHook(() =>
| ^
16 | usePhotosUpload({
17 | photosUploadMutation,
18 | }),
at renderHook (../../../node_modules/react-hooks-testing-library/lib/index.js:151:30)
at Object._callee$ (__test__/hooks/usePhotosUpload.test.js:15:36)
at tryCatch (../../../node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (../../../node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (../../../node_modules/regenerator-runtime/runtime.js:114:21)
at asyncGeneratorStep (__test__/hooks/usePhotosUpload.test.js:13:103)
at _next (__test__/hooks/usePhotosUpload.test.js:15:194)
at __test__/hooks/usePhotosUpload.test.js:15:364
at Object.<anonymous> (__test__/hooks/usePhotosUpload.test.js:15:97)
Run Code Online (Sandbox Code Playgroud) magento ×4
enzyme ×2
jestjs ×2
ajax ×1
angularjs ×1
docker ×1
ecmascript-6 ×1
javascript ×1
reactjs ×1