我正在使用Zend Framework 2的KJSencha模块来使用ExtJS。 模块是根据文档配置的。所有其他事情都很有效。
我的应用程序必须使用模块 - 应用程序和后端。应用程序为空,但具有已定义的layout.phtml。后端模块有index.phtml和IndexController,空的indexAction()。
Backend \ Direct \ Model中有三个模型:Object,Single和Collection。它们用于Direct。
后端\设置\ module.config.php
'kjsencha' => array(
'direct' => array(
'services' => array(
'Direct.Tree' => 'Backend\Direct\Model\Tree',
'Direct.Single' => 'Backend\Direct\Model\Object',
'Direct.Collection' => 'Backend\Direct\Model\Collection',
),
),
)
我想让Object-> update()成为表单处理程序。
我花了几个小时才找到原因,但是apiBuilder仍然没有将'formHandler:true'附加到我的方法中。
除此之外还有什么可做的吗?
namespace Backend\Direct\Model;
class Object extends \Backend\Direct\Entity
{
// .....
/**
* @\KJSencha\Annotation\Formhandler
*
*/
public function update($entity, $id)
{
// TODO: Implement update() method.
return array();
}
// .....
}
应用程序\视图\布局\ layout.phtml
<?php
echo $this->doctype(); ?>
<html lang="en">
<head>
<meta charset="utf-8">
<?php echo $this->headTitle('PROM-PC v.2') ?>
<?php
echo $this->headLink();
echo $this->headScript();
?>
</head>
<body>
<?php
echo $this->content;
echo $this->inlineScript();
?>
</body>
</html>
后端\视图\后端\指数\ index.phtml
<?php
$this->extJs()->loadLibrary();
// load custom variables set in configuration
$this->kjSenchaVariables();
// add loader configuration, which tells where ExtJs classes have to be loaded from
$this->kjSenchaLoaderConfig();
// preloads modules required to get the app running
$this->kjSenchaDirectApi();
// loads your actual application script (usually at the end of your body tag)
$this->inlineScript()->appendFile($this->basepath() . '/backend/js/app.js');
结果如下:
Ext.direct.Manager.addProvider({"type":"kjsenchamoduleremoting","url":"\/kjsencha\/rpc\/","actions":{"Direct.Tree":[{"name":"read","len":2},{"name":"update","len":2},{"name":"create","len":2},{"name":"destroy","len":2}],"Direct.Single":[{"name":"read","len":2},{"name":"create","len":2},{"name":"update","len":2},{"name":"destroy","len":2}],"Direct.Collection":[{"name":"read","len":2},{"name":"create","len":2},{"name":"update","len":2},{"name":"destroy","len":2}],"KJSencha.echo":[{"name":"__construct","len":1},{"name":"greet","len":1}]}});
答案 0 :(得分:0)
这是同样的问题 Zend_Reflection doesn't get the docblock for certain classes
解决方案: 尝试将行结尾从Windows转换为Unix风格。
这是Zend \ Reflection的错误吗?