duanfuxing2417 2014-05-14 15:36
浏览 50

zend的问题,调用未定义的函数libxml

I'm starting to use zend framework and trying to submit a form I get this error message: Fatal error: Call to undefined function libxml_disable_entity_loader() in /usr/local/ZendFramework/library/Zend/Xml/Security.php on line 85

Someone who can help me please, I thank you in advance. :)

Controller.php

public function addAction()
{
    $this->view->title = "Agregar album";
    $this->view->headTitle($this->view->title);
    $form = new Application_Form_Album ();
    $form->submit->setLabel('Agregar Album');
    $this->view->form = $form;

    if ($this->getRequest()->isPost())
    {
        $formData = $this->getRequest()->getPost();

        if ($form->isValid($formData))
        {
            $artista_id = $form->getValue('artista_id');
            $nombre = $form->getValue('nombre');
            $fecha = $form->getValue('fecha');
            $descripcion = $form->getValue('descripcion');

            $fecha = $this->fechaMysql($fecha);

            $albums = new Application_Model_DbTable_Album ();

            $albums->agregar($artista_id, $nombre, $fecha, $descripcion);

            $this->_helper->redirector('index');
        }
        else
        {
            $form->populate($formData);
        }
    }
}

Form.php

<?php

class Application_Form_Album extends Zend_Form
{

    public function init()
    {
        $this->setName('albums');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $nombre = new Zend_Form_Element_Text('nombre');
        $nombre->setLabel('Nombre del album:')->setRequired(true)->
            addFilter('StripTags')->addFilter('StringTrim')->
            addValidator('NotEmpty');

        $artista = new Zend_Form_Element_Select('artista_id');
        $artista->setLabel('Seleccione artista:')->setRequired(true);

        $table = new Application_Model_DbTable_Artista();

        foreach ($table->listar() as $c)
        {
            $artista->addMultiOption($c->id, $c->nombre);
        }

        $descripcion = new Zend_Form_Element_Text('descripcion');
        $descripcion->setLabel('Descripcion:')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim');

        $fecha = new Zend_Form_Element_Text('fecha');
        $fecha->setLabel('Fecha lanzamiento:')->setRequired(true)->addFilter('StripTags')->
            addFilter('StringTrim')->addValidator('NotEmpty');
        $valiDate = new Zend_Validate_Date();
        $valiDate->setFormat('dd-mm-YYYY');
        $fecha->addValidator($valiDate);
        $fecha->setValue(date("d-m-Y"));

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $nombre,
            $artista, $descripcion, $fecha, $submit));
}

}

View.phtml

<div class="formContainer">
    <?php echo $this->form ?>
</div>
  • 写回答

1条回答 默认 最新

  • dongweng6241 2014-05-14 16:21
    关注

    I suspect this is your problem: http://framework.zend.com/issues/browse/ZF-12442

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP