zend-framework

Zend Framework: How do I remove the decorators on a Zend Form Hidden Element?

六眼飞鱼酱① 提交于 2019-12-18 10:03:10
问题 I'm trying to remove the default decorators on a hidden form element. By default, the hidden element is displayed like this: <dt>Hidden Element Label (if I had set one)</dt> <dd><input type="hidden" name="foobar" value="1" id="foobar"></dd> I don't want my hidden element to take up space on my page. I want to remove all the default decorators so all I'm left with is the input tag. <input type="hidden" name="foobar" value="1" id="foobar"> How can I achieve this? 回答1: For hidden field you need

validate age before registering a user to check if hes over a certain age using mvc

为君一笑 提交于 2019-12-18 09:49:38
问题 hi i have to develop a form which takes user age and calculates age and if over 18 procedds to take him to registeration form my question is has i am using zend framework how to implement it when its not supposed to interact with model much and their is no data in database how can i validate age of the person i m trying to use this code $data = array ( 'dob' => date ( "Y-m-d" )); $select = $db ->select() ->from('data', array( 'id', 'age' => new Zend_Db_Expr("DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW(

Number of affected rows Zend DB (UPDATE)

时光总嘲笑我的痴心妄想 提交于 2019-12-18 06:13:21
问题 I'm new to Zend Framework and I'd like to know how I can get the number of affected rows from this: $sql = "UPDATE auth SET act='', status='1' WHERE username = ? AND act = ? "; $stmt = $this->dbh->prepare($sql); $stmt->execute(array($this->username, $this->key)); I saw a few posts on this forum, but they we based on MySQLi and SELECT statements where you can actually count the rows using count() . Can anyone suggest how I can alter this to support rowCount . This is how I connect to my

Zend Framework Render Barcodes Into PDF Pages

别来无恙 提交于 2019-12-18 05:18:05
问题 I'm trying to create PDF pages with barcodes that have correct margins to be printed on sheets of labels (If you have another idea of how to print barcodes onto labels without PDF generation, I'd love to hear it). Below is what I have currently for code: $pdf = new Zend_Pdf(); for($i = 1; $i <= $numberOfPages; $i++) { $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 20); $pdf->pages[] = $page; } foreach($pdf->pages

Zend - How to install on WAMP

杀马特。学长 韩版系。学妹 提交于 2019-12-18 05:14:15
问题 If there is an easy to follow instruction or tutorial that I can use to learn how to install Zend on my machine that has a WAMP installation? The video listed http://www.zendcasts.com/getting-started-with-zend-and-wamp-server/2009/06/ is hard to read what he is writing. Thank you 回答1: Conceptually, the whole thing is: Create virtual host pointing it to the sample app Make sure that PHP include_path contains the path to the Zend library. But the specifics can be tricky if you are not

Working with Zend Framework FlashMessenger and jQuery UI state classes

孤街浪徒 提交于 2019-12-18 05:12:17
问题 I have a Zend Framework application that is making use of jQuery UI. In my controllers, I am setting error/success messages with the FlashMessenger helper like this: // ExampleController.php $this->_helper->FlashMessenger('Sorry, could not complete your request.'); In my layout, I am displaying the messages by using the Noumenal FlashMessenger View Helper // layout.phtml <?php echo $this->flashMessenger(); ?> I want to make use of my jQuery UI theme's CSS styles to style my error messages

Integrating external scripts with Zend Framework

北战南征 提交于 2019-12-18 04:23:53
问题 What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database. I am using Zend Framework for the site which uses this script and it seems to me that it would be best to use my subclassed model of Zend_Db_Abstract to do the adding and updating of the database. How does one go about

How to indicate zend framework where my custom classes are

守給你的承諾、 提交于 2019-12-18 03:41:37
问题 I have a folder with custom classes in a ZF 1.10 application. The folder is located in /library. How can I tell ZF where they are? Both application.ini and index.php set the path to the library but then ZF can't find the files. Thank you 回答1: There are many possible solutions. The most common, when using Zend Application, is to register the namespace in application.ini by adding: autoloaderNamespaces[] = "Example_" Other solutions: Add your dir to include_path using set_include_path() (ad hoc

Opcode (APC/XCache), Zend, Doctrine, and Autoloaders

喜欢而已 提交于 2019-12-18 03:39:27
问题 I am trying to use either APC or XCache as an opcode to cache my php pages. I am using it with Zend and Doctrine and it's having a problem with the autoloader. If I try with APC, I get the following: Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]: Class Doctrine_Event could not be loaded in C:\\[mydir]\\library\\doctrine\\Doctrine\\Record.php on line 777 If I try with XCache I get the following: PHP Fatal error: Cannot redeclare class Zend_Registry in

Can I use Facebook's hiphop with frameworks like Zend Framework, cakephp, symfony

两盒软妹~` 提交于 2019-12-18 03:33:41
问题 Yesterday Facebook launched HipHop, a sourcecode-converter from php to c++. The set of php functions and constructions is more limited than in standard php. Are the current popular php frameworks (ZF, CakePHP, symfony) compatible with HipHop? If not, which parts of these frameworks are not usable? 回答1: If I'm not mistaken, HipHop has not been released yet -- even the wiki page linked from the Facebook annoucement yesterday is not up yet. So, it's going to be a bit hard to answer, right now. I