I'm using Zend Framework, and am curious about how people handle form submission. Right now, I'm using something like this:
public function editAction()
{
$form = my_form();
$this->view->form = $form;
if ($this->getRequest()->isPost() {
$params = $this->getRequest()->getPost();
if ($form->isValid($params) {...
Hi All
Once again a Zend Framework question! Any help is appreciated.
I have a DB table class which i want to use to insert/update rows when a form is posted, and i would like to use the save() method so it can all go through the same method.
//Users Db Table class
class DBTables_Users extends Zend_Db_Table_Abstract
{
protected ...
Hi all!
I've to change the value of protected $_autoQuoteIdentifiers but I don't know how.
class ZendX_Db_Adapter_Firebird extends Zend_Db_Adapter_Abstract
{
protected $_autoQuoteIdentifiers = true;
.
.
.
Okay, I can change it directly in the class, but this couln't be the the best way.
My application.ini is:
resources.db.adapte...
When you're writing a form you can configure the zend_form_element objects according to your needs. (Adding validators and filters)
Is there a clever way to achieve the same for the validation of "pure" GET parameters?
My task is to make sure that the application is secure and I am thinking about using the form validators and their cha...
I am trying to read and post back to the browser a file uploaded with the zend framework mechanism.
The file has been uploaded correctly to the desired location and as I have checked by
su www-data
and after an ls and a cat, the web user can read it and modify it properly.
the problem is that inside a controller when I try to:
if(...
I'm updating an php web application that is becoming multilingual, based on the Zend MVC framework, and I'm trying to figure out the best approach to passing the translation object to different classes/layers.
Most of my translation is done at the View level, but there are a few cases where I need to return status messages from custom l...
I had a long detailed question about how to get a specific calendar's event feed, but figured (I think) a solution out before I posted. However, even with the solution I'm left wondering what I'm missing about this process. To get a single calendar's event feed (or to search that feed) I do the following:
Authenticate (obviously)
Get a...
Hello
Been looking for a while on how to sort this out. Essentially, I just need to set a label for a Zend Framework Sub Form.
However I try to do this is just doesn't work. Zend Sub Form doesn't have a Label attribute so you can't seem to set it. However, when the form renders, you can clearly see a DT tag inwhich the label should ...
Hi guys, I have a sql problem and i don't know how to fix it, I have tried a few things but..you know.So here is my query:
/**
* Returns a list with all the months for the archive
*
* @return array
*/
public function Archive()
{
$q = "SELECT DISTINCT MONTH(`data`) AS `month`,YEAR(`data`) AS `year` FROM `posts` ORDER BY `data` D...
Hello you all:
I have two routes that match a url with the same apparent pattern, the difference lies in the $actionRoute, this should only be matched if the variable :action on it equals 'myaction'.
If I go to /en/mypage/whatever/myaction it goes as expected through $actionRoute.
If I go to /en/mypage/whatever/blahblah it gets rejecte...
Hi
In my project I have a number of dynamic elements that are consistently on every page. I have put these in my layout.phtml
My question is: How can I send variables into my layout from my controllers?
If I want to send things from my controller I can use:
$this->view->whatever = "foo";
And receive it in the view with
echo $this-...
Hello All,
I have asked this question earlier today but I didn't provide enough information and therefore it was migrated to the serverfault forum.
Well since I think it's not really a server releated problem rather a php related problem i woul lik to ask it here again and ask it properly.
My environment
Xampp installation
PHP ...
Hi all,
I'm having problems returning XML in my ZF Application.
Below is the code I have:
<?php
class ProjectsController extends Gid_Controller_Action
{
public function xmlAction ()
{
$content = "<?xml version='1.0'><foo>bar</foo>";
header('Content-Type: text/xml');
echo $content;
}
}
?>
I've also tried the following:
<?php...
I have Zend_Soap_Server. It should be tested. One issue - unit testing and development modes should work with different databases. It can be done via .htaccess:
SetEnvIfNoCase User-Agent (.*) APPLICATION_ENV=development
SetEnvIfNoCase User-Agent testing APPLICATION_ENV=testing
It would work fine for me, I use Zend_Soap_Client as is fo...
Hey there, does anyone know the best practice to filter all the results I'm getting from any Zend_Db class.
It's because I've got a whole database with timestamps as INTs and I want to change the fields into Mysql's TIMESTAMP without having to change too much code.
It would be nice if I could apply a global database filter using strto...
Here is my query:
"SELECT * FROM `posts` WHERE MATCH(title, text) AGAINST('".$word."' IN BOOLEAN MODE)";
How can I do this with Zend_Db_Table, I mean($this->select()...)
Best Regards!
...
I have a couple of controllers in Zend Framework that starts with p:
/p-home/index
/p-store/index
/p-form/submit
I need to write a router configuration file (using INI file) to automatically rewrite the url to other controllers that starts with s:
/s-home/index
/s-store/index
/s-form/submit
I have tried the following but doesn't work:
...
I'm looking for a way to set the month of Zend_Date using a string from the user (could be Jan, January, etc). For example
$month = strftime("%m", strtotime($month));
$date->set($month, Zend_Date::MONTH);
Will get the month 'number', which then can be used to set the Zend_Date month. Is there a way to do that all with Zend_Date?
...
I need to just translate form error messages in my application.
The application is not multilingual, it is al in Slovak (so I already write labels and stuff in Slovak language), just need to translate error messages.
I have made this method in my bootstrap file:
protected function _initTranslate()
{
$this->translate = new Zend_Tr...
Rather than using controller/action/key1/value1/key2/value2 as my URL, I'd like to use controller/action/value1/value2. I think I could do this by defining a custom route in my Bootstrap class, but I want my entire application to behave this way, so adding a custom route for each action is out of the question.
Is this possible? If so, ...