我有一个问题,因为我需要一个全局静态变量,我有问题是有可能将它添加到application.ini文件,该怎么做?
或者我必须:
谢谢你的建议!Regars,
我有一个问题,因为我想从不同的控制器渲染视图并传递数据.你知道怎么做吗?
我在努力:
$this->renderScript('index/index.phtml')->entries = $result;
Run Code Online (Sandbox Code Playgroud)
但我的if:
if (count($this->entries) <= 0)
Run Code Online (Sandbox Code Playgroud)
返回0
你知道怎么做吗?谢谢!
我有一个Zend表单来向数据库添加内容.然后我想用这个表格来编辑我添加到数据库的内容.是否有可能使用此表单(从数据库填充并显示它?)我在我的控制器中有这个:
public function editAction() {
if (Zend_Auth::getInstance()->hasIdentity()) {
try {
$form = new Application_Form_NewStory();
$request = $this->getRequest();
$story = new Application_Model_DbTable_Story();
$result = $story->find($request->getParam('id'));
// $values = array(
// 'title' => $result->title,
// 'story' => $result->story,
// );
if ($this->getRequest()->isPost()) {
if ($form->isValid($request->getPost())) {
$data = array(
'title' => $form->getValue("title"),
'story' => $form->getValue("story"),
);
$where = array(
'id' => $request->getParam('id'),
);
$story->update($data, $where);
}
}
$this->view->form = $form;
$this->view->titleS= $result->title;
$this->view->storyS= $result->story;
} catch (Exception $e) {
echo $e;
} …Run Code Online (Sandbox Code Playgroud) 我有一个关于在服务器上部署Zend项目的问题.在localhost上,我使用虚拟主机将文档根目录设置为public/index.php文件夹.
我需要一些建议,谢谢
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
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] =
resources.db.isDefaultTableAdapter = true
resources.db.adapter = PDO_MYSQL
resources.db.params.charset = "utf8"
resources.db.params.host = HOST
resources.db.params.username = "p"
resources.db.params.password = "***"
resources.db.params.dbname = "p"
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = …Run Code Online (Sandbox Code Playgroud) 我有问题,我需要创建计时器,但我想传递一个变量,如何做到这一点?AS3有可能吗?
我试过这样的:
bonusPlayer1Timer = new Timer(5000);
bonusPlayer1Timer.addEventListener(TimerEvent.TIMER, bonusChanges(player1));
bonusPlayer1Timer.addEventListener(TimerEvent.TIMER_COMPLETE, bonusChangesRemove(player1));
bonusPlayer1Timer.start();
function bonusChanges(event:TimerEvent, playerBonus:Player):void {
switch (playerBonus.bonus) {
case 0 :
playerBonus.multipleShooting = false;
playerBonus.bonus = -1;
break;
...}}
Run Code Online (Sandbox Code Playgroud)
但我有错误:
1067: Implicit coercion of a value of type Player to an unrelated type flash.events:TimerEvent.
1136: Incorrect number of arguments. Expected 2.
Run Code Online (Sandbox Code Playgroud)
而这个错误是粗线.
我可以这样使用它吗?或者我必须为每个玩家创建两个相同的函数,因为我不允许传递任何不同的参数来定时器函数?
谢谢,
我有一个关于如何创建自定义View Helpers的问题.我想在我的索引视图中更改我的默认日期时间格式.我想编写自己的Helper,因为我觉得它很容易就像PHP一样.我做了:
创建类:
public static class CustomViewHelpers
{
public static MvcHtmlString returnDateString(string format, DateTime date)
{
return MvcHtmlString.Create(date.ToString(format));
}
}
Run Code Online (Sandbox Code Playgroud)我把它添加到web.config中,
我这样用过:
<p><em>
Birth date</em>
<%: CustomViewHelpers.returnDateString("D", Model.Birth_Date); %></p>
Run Code Online (Sandbox Code Playgroud)但我总是得到错误:
编译错误
描述:编译服务此请求所需的资源时发生错误.请查看以下特定错误详细信息并相应地修改源代码.
编译器错误消息:CS1026 :)预期
但我认为这是一个错误的错误,因为当我删除我的线它正常工作,我看到有这些")"标记.你能解释一下为什么这种助手不起作用吗?也许你知道如何在ASP.NET MVC2中编写自己的帮助程序的好教程?
你知道如何在Zend注册需要确认电子邮件吗?Zend有什么机制可以轻松完成吗?我发现只有发送电子邮件的课程,但我不知道Zend在注册过程中对电子邮件确认有特殊支持吗?
谢谢,