zend-framework

Can a Simple Model just Extend Zend_Db_Row (essentially Active Record)?

I know Domain Models and Data Mappers are the OOP snob's choice (using 'snob' in a complementary way, as Martin Fowler calls himself one) - however, even Fowler says in POEAA that "Active Record is a good choice for domain logic that isn't too complex..." I have a simple product and invoice domain model, not too many tables/objects...

Templating Engine Pros and Cons with Zend Framework

I am getting familiar with Zend Framework (and MVC with PHP in general) for a personal project. I have previous experience with Smarty and have no major gripes with it, but I would like to use this project as a good in-depth learning exercise. Those of you familiar with different templating engines and ZF: Do you believe there are better...

Zend Cache is not retrieving cache items after some period of time

Hi, I am using Zend Cache with page caching but it seems to miss the cache after a period of time. For a while it is OK, but I come back tomorrow and hit the page, it doesn't fetch the contents from the cache. why? $frontendOptions = array( 'content_type_memorization' => true, // This remembers the headers, needed for images 'lif...

Country to timezones in PHP/Zend Framework

Is there a way in Zend Framework or default PHP to map a country (using country code) to a list of timezones? As an example I'm trying to replicate the Google functionality when searching for "time in australia right now" which displays all of the timezones and cities for that country. ...

How do I use the Zend Youtube API correctly?

I am trying to access the YouTube API with the Zend libraries that I have included like this (the full path to the Zend library is components/lib/Zend/Gdata.php): //Include Zend Gdata set_include_path('components/lib'); include("Zend/Gdata.php"); I now try to use the framework thus: //Access video data via Zend l...

Zend without Database

Hi, i googled for an hour now but maybe my Google-Fu is just too weak, i couldn't find a solution. I want to create an application that queries a service via JSON requests (all data and backend/business logic is stored in the service). With plain PHP it's simple enough since i just make a curl request, json_decode the result and get wha...

PHP-How to choose XML section based on an attribute?

All, I have a config xml file in the following format: <?xml version="1.0"?> <configdata> <development> <siteTitle>You are doing Development</siteTitle> </development> <test extends="development"> <siteTitle>You are doing Testing</siteTitle> </test> <production extends="development"> <siteTit...

Zend_Translate scan translation files

I've trying to use Zend_Translate from Zend Framework I am using "POEdit" to generate "gettext" translation files. My files are under /www/mysite.com/webapps/includes/locale (this path is in my include path). I have: pictures.en.mo pictures.en.po (I plan on having pictures.es.mo soon) It all works fine if I manually do addTranslation...

How to translate product name and info in Magento

Hi everybody, Magento provide translation feature, a nice one for e-commerce platform. But it seems to me that the translation is only for the predefined magento keyword, like 'add to cart', 'add to wishlist' etc and not for the product name, info, and description that the user input to the store. Does anybody know how to implement thi...

$this->url() to another subdomain

Hello, I created subdomain for my application. host_www.type = "Zend_Controller_Router_Route_Hostname" host_www.route = "www.mywebsite.com" host_www.defaults.module = "default" host_www.defaults.controller = "index" host_www.defaults.action = "index" store_infos.route = "storeinfos/:store" store_infos.defaults.controller = "store" sto...

best place to put xdebug_time_index() to measure page executing time when using ZF

I'm trying to figure out the best place to put xdebug's excellent xdebug_time_index() function so that I get the best indication of page execution times when using a Zend Framework application structure. I was thinking of putting it in post dispatch hook in my controller (all my controllers inherit from a base controller class) but I've...

PHP framework for old application

Hi experts, we have an old large application that was not built on any framework. However now we want to transfer it to a php framework. Its a new area for us so we are not sure what it takes to transfer the older application to a framework like Zend? Any help will be appreciated. thanks ...

Creating Facebook Apps .. going mad

Hi, IU am trying to create my first Application running inside an Facebook Canvas/IFRAME. I am using Zend Framework (PHP) for this project. But I am not able to understand all the different ways facebook is offering. There is an PHP SDK wich works so far. There is an Javascript SDK and something called FBJS? Does someone know a good p...

How to cache pages using background jobs ?

Definitions: resource = collection of database records, regeneration = processing these records and outputting the corresponding html Current flow: Receive client request Check for resource in cache If not in cache or cache expired, regenerate Return result The problem is that the regeneration step can tie up a single server process...

Database, Jquery, Ajax and Zend Framework. How to use all togheter?

I have a form rendered in the view which action is setted to the same page /index. <form action="" name="formRegistro" id="formRegistro"> and a JQuery function which is called when the form is submitted $('#formRegistro').submit(function() { // Retrevies data from the form data = $('#someInput').val() //Execute AJAX $.get( ...

Zend Framework subdomain+subfolder router rewrite problem

I'm new to Zend Framwork and this is an issue I've been struggling for several hours already... I'm trying to chain Hostname and standard Route in order to get url with subdomain+subfolders ie.: http:// lang.mydomain.com/myapplication/public/controller http:// lang.mydomain.com/myapplication/public/controller/action (sorry for the em...

PHP Uploadprogress extension function always returning null, with no upload data.

I am using php 5.3.2 with uploadprogress extension to get a progressbar during upload using zend framework. Even the demo provided with zend is not working. code in zend example - if (isset($_GET['uploadId'])) { set_include_path(realpath(dirname(__FILE__) . '/../../../library') . PATH_SEPARATOR . get_include_path()); ...

[Zend Framework] How to fetch data from another table within a Zend_Db model class?

I have two tables registries and names. Consequently, I have two model classes. I'm coding a method in registries model and I need to fetch all names in the names table/model. How'd I do it? Should a simple new Names() work? But, is it recommended? ...

[Zend Framework] Forms and success output

Well, It's a beginner's question but I really don't know what is the best way. I have a basic CRUD (Create, Retrieve, Update and Delete) in my project and I'd like to output some message if succeeded or not in a div inside the same page. So, basically, I have a form which action is set to the same page and I have a div #statusDiv below...

[Zend Framework] How to create Zend_Db_Select with nested queries?

I don't know if its possible but I'd like to make it a Zend_Db_Select object and I don't know how SELECT * FROM MyTable MT1 WHERE MT1.date = ( SELECT MAX(MT2.date) FROM MyTable MT2 ) ...