2014-01-22 200 views

回答

0

阅读您的意见,我发现它不是ZF2 e rror,甚至可能不是第三方模块,所以它可能是一个ElFinder错误。可能它找不到一些必需的资源。

阅读一些代码和一些webdites,我认为你可能只是缺少viewhelper的url选项,所以ElFinder可以找到他尝试连接的后端路由。

随着QuElFinder,到连接器的路由/quelfinder/connector 所以在您看来,该代码将是:

echo $this->QuElFinder('elfinder', array(
    'width' => "50%", 
    'height' => '300', 
    'url' => '/quelfinder/connector' 
    ) 
); 

此外,你应该去QuElFinder/config/module.config.php

'QuConfig'=>array(
     'QuElFinder'=>array(
下检查一切

,因为正如您在QuElFinder控制器中看到的那样,在connectorAction()函数中,它正在读取该配置,并且有很多路径。

+0

这对我有效 – pandukhabaya

0

这种情况听起来典型的ViewHelper。尽管它也需要应用程序逻辑。您需要将ProductsImages粘合在一起。

由于它是两个独立的模块,您可能会扩展ProductForm并在窗体中注入一个新元素,以便用户可以选择要粘贴到产品的图像。这通常是1-N关系,因为一个产品可以有多个图像,但一个图像只能属于一个产品。

如果您需要更多的帮助,那么你就需要开始编码,然后回来与真正的问题:)

+0

我使用zend框架2与elfinder和它工作正常(内部elfinder视图)。 我有模块命名的选项,问题是当我在选项内使用该elfinder助手查看它给了我错误称为“无法连接到后端。后端未找到。” 这是我使用内部选项代码视图 回声 $这 - > QuElFinder( 'elfinder', 阵列( '宽度'=> “50%”, '身高'=> “300”, )); 请别人帮我, 谢谢 Lanka – pandukhabaya

+0

@pandukhabaya我不知道有关elFinder的信息,我所知道的是人们有很多问题。只要问一下GitHub的elFinder Team/Guy – Sam

+0

我猜你正在使用Celtico的QuElFinder模块,对不对?该错误消息不在QuElFinder的代码中的任何地方,您应该按照代码查看它崩溃的位置。 Probaly与ElFinder,QuElFinder或代码 –

1

您可以使用forward()插件,在那里你可以再另一个控制器操作中执行的控制动作添加回应(ViewModel)作为子视图。

这样做的主要好处是您可以重复使用并保留每个“视图”的控制器逻辑封装。这允许构建像视图那样的小部件而不用耦合/复制代码。

例如

class ProductsController extends AbstractActionController 
{ 
    public function viewProductAction() 
    { 
     //... View product controller logic 
     // 
     // 

     $view = new ViewModel(array('foo', 'bar')); 

     // Dispatch the controller to view images for this 'product_id' 
     $viewManagerView = $this->forward()->dispatch('ImageManager\Controller\ViewImageController', array(
     'action'  => 'view-images', 
     'product_id' => $product->getId(), 
    )); 
     // Attach the child view to the main view 
     if ($viewManagerView instanceof ViewModel) { 
     $view->addChild($viewManagerView, 'productImages'); 
     } 

     return $view; 
    } 

}

的那么products-module/products/view-product.phtml内呈现子视图

echo $this->productImages; 

你可以阅读更多关于前向插件in the documentation