Take note that form->getValues() will return all values from form, including calling
form file element to receive().
Therefore, setFilter rename shall be called before form->getValues line.
Tuesday, August 21, 2012
Monday, August 20, 2012
jQuery Form IFrame
When jQuery.form iframe option is assigned to true,
the result of the iframe will be triggered twice if the result contains javascript.
The solution to the problem is to assign [textarea] tag to wrap up the contain.
But having tags within the textarea tag will cause some unexpected result on the contain.
Therefore, php htmlentities shall fix the issue for the tags within the content.
If you are running on Zend, there will be issue.
By default, you may disable the layout and display the action view template.
But due to requirement to wrap the output with textarea,
we shall need to disable the view template, and do a manual output of the view file.
Solution (in controller):
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$sView = $this->getViewScript();
if ($this->getRequest()->isPost()) {
return "[textarea]" . htmlentities($this->view->render($sView)) . "[/textarea]";
} else {
return $this->view->render($sView);
}
This solution shall output a normal view if its not submitted from the form.
the result of the iframe will be triggered twice if the result contains javascript.
The solution to the problem is to assign [textarea] tag to wrap up the contain.
But having tags within the textarea tag will cause some unexpected result on the contain.
Therefore, php htmlentities shall fix the issue for the tags within the content.
If you are running on Zend, there will be issue.
By default, you may disable the layout and display the action view template.
But due to requirement to wrap the output with textarea,
we shall need to disable the view template, and do a manual output of the view file.
Solution (in controller):
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$sView = $this->getViewScript();
if ($this->getRequest()->isPost()) {
return "[textarea]" . htmlentities($this->view->render($sView)) . "[/textarea]";
} else {
return $this->view->render($sView);
}
This solution shall output a normal view if its not submitted from the form.
Monday, August 13, 2012
lighttpd vs httpd with php
One of the major issue for deploying php application on lighttpd is modrewrite
Here is a good resource on it:
http://lzone.de/articles/rewrite-migrate.htm
http://redmine.lighttpd.net/projects/1/wiki/MigratingFromApache
Here is a good resource on it:
http://lzone.de/articles/rewrite-migrate.htm
http://redmine.lighttpd.net/projects/1/wiki/MigratingFromApache
Saturday, August 11, 2012
atomicorp repository and kloxo
Atomicorp supply php5.3 and mod apc required for centos5 version of kloxo.
But the qmail-toaster version supplied by atomic conflict with lxcenter-updates,
therefore, adding
exclude = qmail*
to the /etc/yum.repos.d/atomic.repo
But the qmail-toaster version supplied by atomic conflict with lxcenter-updates,
therefore, adding
exclude = qmail*
to the /etc/yum.repos.d/atomic.repo
Thursday, August 2, 2012
Setting up Python Mako with MySQL Workbench
It seems that on MAC, does not to include packages from:
/Library/Python/2.7/site-packages/*
Therefore, its not available within the plugin environment of MySQL Workbench.
The solution is to copy
/Library/Python/2.7/site-packages/mako
as:
/Users/james/Library/Application Support/MySQL/Workbench/mako
/Library/Python/2.7/site-packages/*
Therefore, its not available within the plugin environment of MySQL Workbench.
The solution is to copy
/Library/Python/2.7/site-packages/mako
as:
/Users/james/Library/Application Support/MySQL/Workbench/mako
Wednesday, August 1, 2012
jQuery form and Zend_Form File
It appears that Zend Form will validate fail if we are using ajax or jquery form to submit the form.
To fix the issue, just ensure the form is submitted with the parameter: iframe: true
Also note that IE 8 or below will behave strangely when submitting via jQuery Form with file input.
So avoid using it on IE8 or below...
To fix the issue, just ensure the form is submitted with the parameter: iframe: true
Also note that IE 8 or below will behave strangely when submitting via jQuery Form with file input.
So avoid using it on IE8 or below...
Subscribe to:
Posts (Atom)