zend-framework

Rendering Zend_Form (white screen)

Hello everyone! I create simple form in forms/user.php: class Form_User extends Zend_Form { public function __construct() { parent::__construct(); $this->setName('form_user'); $username = new Zend_Form_Element_Text('username'); $password = new Zend_Form_Element_Password('password'); $em...

Define module layout in application.ini

I am trying to set up modules without my Zend Framework application and am wondering how to configure the module to use its own layout script. I am hoping to define it within my application.ini file, but am not sure what to do... I have tried: resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.fr...

Google Buzz API OAuth Problem - Using Zend_OAuth (PHP)

I have successfully gotten an access_token, so it's not a problem with the 3-legged process. The problem starts when I try to add a new post/activity using the Buzz API... Here is my request: POST /buzz/v1/activities/@me/@self?alt=json HTTP/1.1 Host: www.googleapis.com Connection: close Accept-encoding: gzip, deflate User-Agent: Z...

How to fetch a Zend model using a field

I have a database table that looks like this: CREATE TABLE IF NOT EXISTS `articles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `texte` varchar(255) NOT NULL, `rubrique` varchar(255) NOT NULL, PRIMARY KEY (id) ); Which is PDO mapped like this: class Application_Model_DbTable_Articles extends Zend_Db_Table_Abstract { prote...

Zend Route in a route

In my bootstrap file, I have a heck of a lot of routes. Is there a way to use a previous route as part of a new route? For example, if I want to change the url structure of route 'admin', instead of changing it 30 times for all the other routes, can I just include the route 'admin' in front of everything else? Something like: $router-...

Zend Navigation: current page

There is a method isActive() in Zend_Navigation. But it returns true for all the elements in the current path (parent li is active and all the children too, even when the current is parent li). Is there any method like isCurrent(), to determine whether the current menu item is the current page? I just like to add custom class attribute...

What is the correct way to create a database desktop application ?

I just realized that there is no best way to hide MySQL string connection password in my executable file, especially in JAR file. Even encrypting it in EXE would only slow down the process (although I'm not sure how much time would it take to get an encrypted password from an EXE file). So, from my understanding, I need something in th...

Passing a variable from one Controller Action to another.

Hi I would like to pass a variable from one Controller Action to another and display the value on the view script. class ImportController extends Zend_Controller_Action { public function ImportrecordsAction() { //Do some processing and in this case I select //23 to be the value of total rec...

Possible to download a file through the Zend HTTP Client?

I am trying to build a script where it downloads a file using the Zend http client: http://framework.zend.com/manual/en/zend.http.html but I can't find anywhere where it says how to do this so I'm wondering if its possible... The file is dependent on being logged in so I need to have it done through the zend http client so it can make us...

Zend_Form:: how remove all label from zend form?$title->removeDecorator('Label'); for one but for all elements?

Hi, Zend_Form:: how remove all label from zend form?$title->removeDecorator('Label'); for one but for all elements? Thanks ...

Zend framework caching pagination results for different queries

Using Zend Paginator and the paginator cache works fine, but the same cached pages are returned for everything. Ie. I first look at a list of articles, when i go to view the categories the articles list is returned. How can I tell the paginator which result set i am looking for? Also, how can I clear the paginated results without re-que...

Zend_Mail sending special characters breaking email in client

I am using Zend_Mail to send an email of a log file, but it is sending dodgy characters that the mail clients don't like. My code: <?php $sBody = "errors.log (>= WARN):\n\n"; $rFile = fopen($sErrorsLog, "r"); while (!feof($rFile)) { $sLine = fgets($rFile); $sBody.= $sLine; } $oMail = new Zend_Mail(); $oMail->addTo($sTo) ...

Don't save URL in history, any header or meta-tag?

Is there any HTTP-headers or meta-tags one can use to avoid getting a URL into the browser history? For example, I don't want http://domain.td/show/super-secret-unique-token-that-is-private to show up in the browser URL bar, when I start typing "domain.t". Currently I have a (POST) search form on the website to load the tokens, and ...

Emulating Zend Framework's CookieJar

I'm porting over some function using Zend_Http_CookieJar but need some clarification. Presumably the CookieJar only lasts as long as the instance is running. So could I use curl to produce the same thing? : curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiefil...

Why apache is recv()-ing something for 15 sec every time?

I have ZendFramework based application that is using XMLRPC communication to other ZendFramework app. Both are on the same server (for development). That communication is very slow, and I am trying to find out why. After profiling, I got to the point where there is a slowdown within fgets() of ZF Lib XMLRPC reader. While strace-ing Zen...

What's the best way to escape vars in Zend_View automatically?

A week or two ago I just started using Zend Framework seriously and have had trouble escaping manually with Zend_View::escape(). Does anyone knows how to escape vars in templates (Zend_View templates) automatically without using $this->escape(), or any other tricky ways like output buffering and PREG replacing *.phtml files. I'd like to...

Zend_Form:: How can be code dublication prevented?When only choosen elements of the form used.

Hi, Zend_Form:: How can be code dublication prevented?When only choosen elements of the form used. (My restriction: Cant create label with zend_form because i have integrate cushycms- soo i have to write label by hand each time like i show in my code) The case: need to use in a lot of views same form elements not all of them. The sol...

How we should use zend view helper form with validators + filters?

Hi, How we should use zend view helper form with validators + filters? Example that miss validators + filters from: http://framework.zend.com/manual/en/zend.view.helpers.html <form action="action.php" method="post"> <p> <label>Your Email: <?php echo $this->formText('email', '[email protected]', array('size' => 32)) ?> </label> ...

Creating a php script to run as cron job - using Zend Framework library...

Hi guys I'm creating a php script that would be called as a cron job. However I need to use the functionalities of the Zend framework. The thing is that relative referencing of files especially in includes don't work when programming for being run via command line so I'm stuck with how do I use the zend libraries here. I don't want to go...

How to convert a country string to its ISO 3166-1 code using Zend?

Does anybody know if it's possible to use Zend_Locale to get the ISO 3166-1 code for a country if you have the country name as a string? For example I have "Nederland" so I would like to get "NL". ...