zend-framework

Zend Framework - counting rows in select clause ?

Hello! I'm investigating Zend Framework and currently stucked in counting resulting rows of sql query... Every method I try (from documentation and some blogposts and tutorials) returns an error (like Call to undefined function) or simply gives the incorrect value. I've tried this: $checkquery = $db->select() ->from('users', 'COUNT(...

Capture output of another action within current action?

I have been trying to find a way to capture the output (rendered view) of another action within the current action... something akin to output buffering. The scenario is that I need to save a "snapshot" of a report. The data used in the report is ever-changing, and for whatever reason I need to actually save the view HTML rather than ju...

How do I access a variable defined in URL when using Zend Framework?

I had a read of the documentation, but couldn't see an example of how it would be possible to use the variable in traditional PHP style of $_POST['var'] I'm pretty sure my URL is legit: domain.com/module/controller/action/var/value/ Using the above as an example: $var didn't work $_POST['var'] didn't work How is it done? ...

How to use the Zend_Log instance that was created using the Zend_Application_Resource_Log in a model class

Our Zend_Log is initialized by only adding the following lines to application.ini resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.mode = "a" So Zend_Application_Resource_Log will create the instance for us. We are already able to access this instance in controllers via the following: public function getL...

Zend_Controller_Router_Route: Could not find a translator

I am developing a multilanguage application. In the bootstrap there is the routes setup: protected function _initRoutes() { $this->bootstrap('frontController'); $router = $this->frontController->getRouter(); // PAGES ROUTE $page = new Zend_Controller_Router_Route( ':language/:ident', array( ...

How can I search for an email using the zend framework?

Hi guys I need to build a functionality that involves searching through emails in an inbox for emails whose subjects match a certain user inputted keyword. SInce I'm using the zend framework I would like a solution that uses the zend framework libraries. Aside this I have noticed that the zend libraries are a bit limited with respect to...

Zend Rest Client issue

Hi all i have the codes below class ReservationController extends Zend_Controller_Action { public function init() { } public function indexAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->layout->disableLayout(); $soap = new Zend_Rest_Server(); $soap->setClass...

Optional param Zend Route Regex

Hello, How to make route regex parameters optionals with Zend ? I try to make well formatted URLs ("search?s=mp&t=w" instead of "search/index/s/mp/t/w") for search filters, ex. : Popularity Most popular (s=mp) Most viewed (s=mv, default) Top rated (s=tr) Most commented (s=mc) Period All period (t=a, default) Today...

Can't use my form

I have class with my form in folder /application/forms/Auth.php it looks like class Form_Auth extends Zend_Form { public function __construct() { $this->setName(); parent::__construct(); $username = new Zend_Form_Element_Text('username'); $password = new Zend_Form_Element_Password('password'); ...

Zend and mootools

Hi There, I am trying to write a commenting system with Zend and Mootools, basically mootools provides and modalbox and Zend processes the comment etc. My issue is that I cannot get the ID of the post that the user is commenting on to move from Javscript to PHP. I think it is because the Modal window is an iFrame essentially. Below is...

row specific class

How do I create a Zend_Db_Table which returns a different class for each row.? Example UserTable has id,name and type Type contains class names (admin,client,etc...) The classes admin, client are all subclasses of user If I call fetch I need to get a admin or client object depending on the corresponding value in the db. ...

Doctrine findOneBy invalid field name where field does exist

I'm using Zend Framework with Doctrine. I'm creating an object, editing, then saving it. That works fine. However, when I later try to find that object based on one of the column values, Doctrine throws an error saying, "Message: Invalid field name to find by:". Notice there is no field name listed in the error message after the :. My ...

Is Zend Framework 1.10.x compatible with PHP 5.3?

I'm currently developing in (learning) ZF1.10. I also just set up a new development server using Ubuntu 10.04 which came with php 5.3 I know that ZF will start using php 5.3 functionality as of ZF2, but will ZF1.10 work fully and normally running on a php 5.3 machine or should I downgrade my php? For example, my own legacy code has prob...

Zend_DB union() : Zend_Db_Table_Abstract vs Zend_Db_Table::getDefaultAdapter()

So i have this raw SQL that i want to call via the zend framework select t.type, t.tid,t.tname,t.cid,t.cname, ls.* from ( select t.type, t.id as tid, t.name as tname, c.id as cid, c.name as cname from team t join company c on t.parent=c.id and t.type='C' and c.sector=20 and t.status='ACTIVE' union select t.ty...

Using OpenID with Zend Framework.

I want my website to do exactly what Stackoverflow does with openId. I'm combing through sources, and I have done this before with facebook, but not making much progress with OpenID. What I would like to do is just detect if someone has logged into Google, and if they have get some identifying information, and allow them to federate ...

Can't call method in model table class using Doctrine with Zend Framework

I'm using Doctrine with Zend Framework. For my model, I'm using a base class, the regular class (which extends the base class), and a table class. In my table class, I've created a method which does a query for records with a specific value for one of the fields in my model. When I try and call this method from my controller, I get an e...

Repeated bootstrapping in Zend Framework

I have a fresh install of Zend Framework v1.10.5 on my application server. The only modifications are the two init methods below in which I simply set up a logger and write to it as a part of the bootstrap process. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected $_log; protected function _initLogging() ...

Zend getNumber() not working with thousands separators properly.

I'm having a problem getting some numbers to display properly using zend. The country code is for france "fr_FR" Here's the code: include_once '../classes/zend/library/zend/currency.php'; $value = '2 123,25'; $number = Zend_Locale_Format::getNumber($value, array('precision' => 4, 'locale' => 'fr_FR') ); return $number; I'm expecting...

How to get bootstrap resource in front controller plugin [Zend Framework]

protected function _initDatabase() { $params = array( 'host' => '', 'username' => '', 'password' => '', 'dbname' => '', ); $database = Zend_Db::factory('PDO_MYSQL', $params); $database->getConnection(); return $database; } . class App_Controller_Plugin_Tes...

Cannot Access Zend Framework Libray through a PHP File?

I have kept the zend library in E:\wamp\www\Library\ this directory exists in the include_path inside php.ini of PHP and Apache both But whenever I am trying to use a class, it sends a error message that it cannot find the file ...