zend-framework

jquery ajax call returning error when its not an error

Hello, My JS Is: $(InitFavorite); function InitFavorite(){ var jList = $(".favourite_link"); var ids_to_check = {};//new Array(); $.each(jList, function () { var id = this.id; var object = id.split("_"); if (!ids_to_check[object[1]]) { ids_to_check[object[1]] = []; } ...

Unable to list owned images and running instances from Amazon Web Services using Zend Framework

I am using Zend Framework's library to manage EC2 instances and AMI. However I can't list the AMI's I own and can't list existing EC2 instances. $ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey); $instances = $ec2Instance ->describe(); $ec2Instance ->describe() should list all instances but it is return...

PHP/Zend: How to remove all chars from a string and keep only numbers.

I want to keep only numbers and remove all characters from a variable. For example: input: +012-(34).56.(ASD)+:"{}|78*9 output: 0123456789 ...

Zend/PHP: How to remove all leading 0s from string ?

I have a string which contains only numbers. Now I want to remove all leading 0s from that string For example: input: 000000001230 output: 1230 input: 01000 output: 1000 Is there any function in PHP/Zend for this? Thanks ...

Zend Framework View Script not finding path

Hi to all Expert, Please help me, i m newbie to zend framework. I installed zend framework on ubuntu machine but when i goes for "http://zf.local/Users/index" it works fine but when i enter into address bar "http://zf.local/Users/Login" it shows me following error: An error occurred Application error Exception information: Message: scr...

ForceContext Queries method twice?

Hello, I'm doing a per minute script, to output the xml that a server will read. Ive logged url requests and for some reason, calling this url once, calls it twice! It seems that as soon as Zend notices the tag, it re-renders the method. echo $this->minutes; exit; -method successfully called once echo '< html >'.$this->minutes.'< / h...

Zend Framework and UTF-8 characters (æøå)

Hi, I use Zend Framework and I have problem with JSON and UTF-8. Output \u00c3\u00ad\u00c4\u008d Ã­Ä I use... JavaScript (jQuery) contentType : "application/json; charset=utf-8", dataType : "json" Zend Framework $view->setEncoding('UTF-8'); $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8'); header(...

How do I add complex where clause to Zend Table Select?

I searched the Web and could not find anything that would show me a good solid example. My question is basically this: How do I convert this: SELECT * FROM table WHERE ((a = 1 AND b = 2) OR (c = 3 OR c = 4)) AND d = 5; To Zend syntax similar to this: $this ->select() ->from($this->_schema.'.'.$this->_name) ->where('a = ?', '1'); ...

Zend Framework - Database Table Singleton

I have found myself doing this in my code to 'cache' the work done when instantiating my Zend_Db_Table models: if (Zend_Registry::isRegistered('x_table')) { $x_table = Zend_Registry::get('x_table'); } else { $x_table = new Default_Model_DbTable_X; Zend_Registry::set('x_table', $x_table); } It bothered me that this method i...

Zend/PHP: Problem uploading/downloading file to/from MySQL's BLOB field.

I am uploading file(pdf for now) like this: (It is uploading content of file in blob field of mysql) $organizationModel = new Model_Organization_Object( organizationId ); $myFile = file_get_contents( '../path/to/my/file/filename.ext' ); $organizationModel->setOrganizationProfile( $myFile ); $organizationModel->save(); Now I want to ge...

Validators are not working anymore in Zend Framework?

Eariler I happily used the following code for creating form elements (inside Zend_Form descendant): //Set for options $this->setOptions(array( 'elements' => array( 'title' => array( 'type' => 'text', 'options' => array( 'required'...

Zend Framework how to echo value of SUM query

Hello, I created a query for the zend framework, in which I try to retrieve the sum of a column, in this case the column named 'time'. This is the query I use: $this->timequery = $this->db_tasks->fetchAll($this->db_tasks->select()->from('tasks', 'SUM(time)')->where('projectnumber =' . $this->value_project)); $this->view->sumtime = $t...

How to access the value of a url variable in a Zend view Helper?

I want to access the value of a specific variable (in the url) in my view helper. How can I do this? I'm able to get my controller name with: Zend_Controller_Front::getInstance()->getRequest()->getControllerName(); , but I have no idea for the variable ... Thanks in advance! ...

Doctrine SQL query: works on MySQL, on PostgreSQL won't

This is a query automatically generated by Taggable extension for Doctrine ORM. SELECT t.id AS t__id, t.name AS t__name, COUNT(DISTINCT i.id) AS i__0, (COUNT(DISTINCT i.id)) AS i__1 FROM taggable_tag t LEFT JOIN cms__model__image_taggable_tag c ON (t.id = c.tag_id) LEFT JOIN image i ON i.id = c.id WHERE t.id IN (SELECT doctrine_s...

Extending Zend_Log for application-specific need

I am building a Zend Framework application that performs jobs submitted by the user. The actions taken need to be logged to a database. I would like to correlate the job with its log entries. Instead of creating my own logging class, I would like to extend Zend_Log since it provides 99% of the functionality that I need. All I need to...

Zend framework forms, upload file problem

Hi, I use Zend forms in my web application. I wonder where Zend puts uploded temp file by default ? I can't find it in server tmp dir. For example if I upload image(1.jpg) via file field, it appears on tmp folder, but as 1.jpg(/tmp/1.jpg). But I need temporary file like /tmp/phpeZApBn. Maybe it is in any other location ? Any help woul...

PHP/Zend: How to force browsers to don't show warnings on webpage for a particular case?

I am trying to get twitter updates like this: try { $doc = new DOMDocument(); $doc->load('http://twitter.com/statuses/user_timeline/1234567890.rss'); $isOK = true; } catch( Zend_Exception $e ) { $isOK = false; } If there is not problem with internet connection then $isOK = true; is set. But if there is a problem in loading t...

404 Not Found When Requesting URI With Encoded Patameters

I am pretty sure this is some problem with the Apache configuration because it used to work on the previous hosting provider with the same PHP/MySQL configuration. In my application, users are able to delete photos by going to URIs like this: http://example.com/my-account/remove-media/id/9/ret/my-account%252Fedit-album%252Fid%252F1 Th...

Call asynchronosuly two functions

Hi, This a php script.I need to download a file using php code. The zip file can be accessed via a http path.The size is around 400 mb+.Currently i use copy command to save the file(this file lies in another server which is accessed through eg- http://sample.com/myzip.zip) which to local machine.But since its a large file the browser t...

how to check if the enddate is after the startdate in a zend form

I have a zend form with a start- and an endate. $form = new Zend_Form(); $form->setName($this->formName) ->setMethod('post'); $feStartdate = new Zend_Form_Element_Text('startdate'); $feEnddate = new Zend_Form_Element_Text('enddate'); $form->addElement($feStartDate) ->addElement($feEndDate) ->addElement('submit', 'submit...