- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经关注了以下 documentation我有问题。我以 localhost/epos 访问 url,索引页面工作正常。但如果我这样做 localhost/epos/pgeline2d 我得到错误
An error occurred
Page not found
Exception information:
Message: Invalid controller specified (epos)
Stack trace:
#0 /opt/eposdatatransfer/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /opt/eposdatatransfer/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /opt/eposdatatransfer/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /opt/eposdatatransfer/public/index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'epos',
'action' => 'guestbook',
'module' => 'default',
)
我的 SQLLite 数据库中的表名为“PGE_Line2D”。以下是我的文件:
httpd.conf
Alias /epos "/opt/eposdatatransfer/public"
<Directory "/opt/eposdatatransfer/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
应用程序/配置/application.ini
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
phpSettings.date.timezone = "Europe/London"
resources.db.adapter = "PDO_SQLITE"
resources.db.params.dbname = APPLICATION_PATH "/../data/db/h3111142.db"
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
应用程序/bootstrap.php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {}
应用程序/views/scripts/index/index.phtml
hello
应用程序/ View /脚本/pge-line-2d/index.phtml
<br /><br />
<div id="view-content">
<p>View script for controller <b>PgeLine2D</b> and script/action name <b>index</b></p>
<?php foreach ($this->entries as $entry): ?>
<dt><?php echo $this->escape($entry->pga_id) ?></dt>
<?php endforeach ?>
</div>
应用程序/模型/PGLine2D.php
class Application_Model_PgeLine2D
{
protected $_PGA_Id ;
protected $_PGA_Name ;
public function __construct(array $options = null)
{
if (is_array($options)) {
$this->setOptions($options);
}
}
public function __set($name, $value){
$method = 'set' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid set PgeLine2D property');
}
$this->$method($value);
}
public function __get($name){
$method = 'get' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid get PgeLine2D property');
}
return $this->$method();
}
public function setOptions(array $options)
{
$methods = get_class_methods($this);
foreach ($options as $key => $value) {
$method = 'set' . ucfirst($key);
if (in_array($method, $methods)) {
$this->$method($value);
}
}
return $this;
}
public function setPGA_Id($id){
$this->PGA_Id = $id;
return $this;
}
public function getPGA_Id(){
return $this->PGA_Id;
}
public function setPGA_Name($name){
$this->PGA_Name = $name;
return $this;
}
public function getPGA_Name(){
return $this->PGA_Name;
}
}
应用程序/模型/PGLine2DMapper.php
class Application_Model_PgeLine2DMapper
{
protected $_dbTable;
public function setDbTable($dbTable)
{
if (is_string($dbTable)) {
$dbTable = new $dbTable();
}
if (!$dbTable instanceof Zend_Db_Table_Abstract) {
throw new Exception('Invalid table data gateway provided');
}
$this->_dbTable = $dbTable;
return $this;
}
public function getDbTable()
{
if (null === $this->_dbTable) {
$this->setDbTable('Application_Model_DbTable_PgeLine2D');
}
return $this->_dbTable;
}
public function save(Application_Model_PgeLine2D $pgeLine2D)
{
$data = array(
'PGA_Name' => $pgeLine2D->getPGA_Name()
);
if( null === ($id = $pgeLine2D->getPGA_Id()) ) {
unset($data['id']);
$this->getDbTable()->insert($data);
} else {
$this->getDbTable()->update($data, array('PGA_Id = ?' => $id));
}
}
public function find($id, Application_Model_PgeLine2D $pgeLine2D)
{
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
}
$row = $result->current();
$pgeLine2D->setPGA_Id($row->PGA_Id)
->setPGA_Name($row->PGA_Name);
}
public function fetchAll()
{
$resultSet = $this->getDbTable()->fetchAll();
$entries = array();
foreach ($resultSet as $row) {
$entry = new Application_Model_PgeLine2D();
$entry->setPGA_Id($row->PGA_Id)
->setPGA_Name($row->PGA_Name);
$entries[] = $entry;
}
return $entries;
}
}
应用程序/模型/DbTable/PGLine2D.php
class Application_Model_DbTable_PgeLine2D extends Zend_Db_Table_Abstract
{
protected $_name = 'PGE_Line2D';
}
应用程序/ Controller /PgeLine2DController.php
class PgeLine2DController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
$pgeLine2D = new Application_Model_PgeLine2DMapper();
$this->view->entries = $pgeLine2D->fetchAll();
}
}
最佳答案
当您使用别名而不是新域时,您必须添加
resources.frontController.baseUrl = "/epos"
到你的 config.ini 文件。
关于php - 指定的 Controller 无效 () - Zend Framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11157134/
我正在我的 java 作业中使用 GUI,并且我必须指定 JCheckBox 中的其他内容。除了这个小要求,其他的我都完成了。我不太确定如何解决这个问题,我查阅了我的书并尝试在线研究 要求: 一系列复
在各种语言中(我将在这里使用 JavaScript,但我已经在 PHP 和 C++ 中以及可能在其他地方看到过它),似乎有几种构造简单 for 循环的方法。版本 1 如下: var top = doc
有没有一种方法可以使用 CSS 指定每次“小于符号”(在键盘上 M 的右侧)或“大于符号”出现在文本中时,它应该被替换为分别是“小于”或“大于”的实际词? 最佳答案 CSS 不能作用于(不能修改,即)
首先,使用 setspn 命令为用户注册服务主体名称。 setspn -a CS/dummy@abc.com dummyuser setspn -l dummyuser 给出输出为 CS/dummy@
我在指定从 SFSafariViewController 访问时遇到问题,因为它具有与 Safari 浏览器完全相同的用户代理。 我要做的是仅在 webview 内显示图片,如果在普通浏览器上查看,则
我正在尝试用 R 语言在 lavaan 中指定一个奇怪的模型。该模型如下所示: 我的规范尝试如下所示。我发现难以实现的是将观察到的变量的唯一误差固定为唯一项的两个相关性的总和。 例如,项目 y*1,2
我正在构建 API 以将我的 React 应用程序与我的后端服务连接起来,我想使用 typescript 来指定 data 的类型在我的 Axios 请求中。如何在不修改其他字段的情况下更新 Axio
如何为模型指定初始“软”值?该初始模型是解决类似查询的结果,并且该模型很可能具有正确的部分,甚至对于当前查询可能是正确的。 目前,我正在通过增量求解和 hard/soft constraints 对此
我有来自网页的以下代码 https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+Producer+Example 似乎缺少的是如何配置分区数。我
有没有办法在每个查询的基础上在 Neo4jClient 中指定 Cypher 解析器的版本,如 here 所述? 谢谢! 最佳答案 如果您将 Neo4jClient 更新到最新版本(> 1.0.0.6
我有以下代码生成四个图,但它们最终被压扁(见下图)。我该如何解决这个问题? par(mfrow=c(2,2)) curve(.5*exp(-.5*x),from=0,to=10,main="f(x)"
我有一个 ColdFusion 10 服务器。我正在使用 JDBC 驱动程序连接到 db2 数据库。我偶然发现了这个笔记。这个设置在哪里?我还查看了 neo*.xml 文件,但没有看到任何 db 驱动
我想知道是否可以指定验证器的运行顺序。 目前,我编写了一个自定义验证器,检查它是否为 [a-zA-Z0-9]+ 以确保登录验证我们的规则,并编写了一个远程验证器以确保登录可用,但目前远程验证器已启动在
我的应用程序需要至少 40MB 的 RAM,因此早期的 iPhone(例如 3G、第一个 iPod touch 版本)就没有它(它们为我的应用程序提供的最大内存约为 20MB)。有没有正确的方法来禁用
我有一个保存日期(不是当前日期)的 Date 对象,我需要以某种方式指定该日期为 UTC,然后将其转换为“欧洲/巴黎”,即 +1 小时。 public static LocalDateTime toL
我想问你在 Varnish 代码中如何在没有缓存的情况下将请求传递到后端。 我知道我可以做到并且正在发挥作用: if (req.url ~ "(\?|&)(something|somethin
我目前基于模块编译程序(如主程序 foo 依赖于模块 bar )如下: gfortran -c bar.f90 gfortran -o foo.exe foo.f90 bar.o 这在 foo.f90
我正在尝试创建一个依赖于另一个 meteor 包的新 meteor 包。当我尝试 meteor add mypackage 时,出现以下错误。为什么 Meteor 不添加 mypackage 并引入它
我正在制作执行器/ react 器,同时发现这是一个终生的问题。它与 async/Future 无关,可以在没有 async 糖的情况下进行复制。 use std::future::Future; s
我在 cassandra 中有一个表,其数据类型为时间戳。我正在使用 cqlsh 从数据库中获取数据,并希望更改我的时间戳列输出的输出格式。我研究了一下,发现我可以通过更改以下文件来更改时间戳输出格式
我是一名优秀的程序员,十分优秀!