小编use*_*948的帖子

Zend Framework:行动不存在

这是我的表单生成器功能:

private function getAddArtistForm() {
  $form = new Zend_Form();
  $form->setAction("saveArtist");
  $form->setMethod("post");
  $form->setName("addartist");
  ...
}
public function newAction()
{
  $form = $this->getAddArtistForm();
  $this->view->form = $form;

}
Run Code Online (Sandbox Code Playgroud)

我还有一个名为的行动saveArtistAction:

public function saveArtistAction() {
...
}
Run Code Online (Sandbox Code Playgroud)

但是当我提交表单时,我收到以下错误:

Message: Action "saveartist" does not exist and was not trapped in __call() 
Run Code Online (Sandbox Code Playgroud)

请求参数:

array (
  'controller' => 'artist',
  'action' => 'saveartist',
  'module' => 'default',
)  
Run Code Online (Sandbox Code Playgroud)

php zend-framework zend-form

1
推荐指数
1
解决办法
3010
查看次数

lex 中 INITIAL 的含义

在下面跳过注释的代码中, 的含义是什么BEGIN(INITIAL)

    %x C_COMMENT

    “/*”{ 开始(C_COMMENT); }
    “*/”{ 开始(初始);}
    。{ }

lex

0
推荐指数
1
解决办法
2745
查看次数

strcmp的返回值是什么意思?

我知道strcmp会回来......

大于零的值表示不匹配的第一个字符在str1中的值大于在str2中的值; 小于零的值表示相反.

但这些正数或负数意味着什么呢?例如,2是什么意思?

c++

0
推荐指数
3
解决办法
525
查看次数

PHP"意外的文件结束..."语法错误

我已经下载了一个php web应用程序(Studip).当我去index.php时,我收到以下错误:

Parse error: syntax error, unexpected end of file in /var/www/html/studip/public/index.php on line 248

我检查了语法,没有语法错误.还有什么导致此错误吗?

这是文件:

<?php
# Lifter002: TODO
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/**
 * index.php - Startseite von Stud.IP (anhaengig vom Status)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or …
Run Code Online (Sandbox Code Playgroud)

php

0
推荐指数
1
解决办法
2万
查看次数

Zend框架2错误:无法呈现模板

我正在研究这个教程.我已按照所有步骤创建目录结构,控制器,module.php和module.config.php,但是当我打开时,http://zf2-tutorial/album我收到以下错误:

 Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "album/album/index"; resolver could not resolve to a file' in /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:461
Run Code Online (Sandbox Code Playgroud)

index.phtml在view/album/album目录中创建了一个名为module目录的文件.

module.config.php:

return array(
    'controllers' => array(
        'invokables' => array(
            'Album\Controller\Album' => 'Album\Controller\AlbumController',       
        ),
        'view_manager' => array(
            'template_map' => array(
            'layout/layout'           => __DIR__ . '/../view/layout/layout.phtml',
            'album/album/index' => __DIR__ . '/../view/album/album/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
                ),
            'template_path_stack' => array(
                'album' => __DIR__ . '/../view',
            ) …
Run Code Online (Sandbox Code Playgroud)

zend-framework2

0
推荐指数
1
解决办法
3万
查看次数

使用include_once会导致未定义的变量通知

我有一个名为"config.php"的文件,其中包含一个名为的变量$unit_names.在类中,我有以下方法,它通过它的id返回单元名.我对表中的所有行使用此方法,但问题config.php仅包含在对方法的第一次调用中.下次通话会导致通知:undefined variable $unit_names...

如果我更换include_onceinclude通知消失.但为什么?include_once应该加载config.php文件.

public function get_unit_name($unit_id) 
    {   
            include_once("config.php");
            return $unit_names[$unit_id];
    }   
Run Code Online (Sandbox Code Playgroud)

php

-1
推荐指数
1
解决办法
1697
查看次数

标签 统计

php ×3

c++ ×1

lex ×1

zend-form ×1

zend-framework ×1

zend-framework2 ×1