Hello,
I have been getting into Unit Testing with Zend Framework. I am getting used to the other things it provide but I am having a hard time understanding Mock Objects.
For this example, I am trying to use a Mock Object to test out my model.
<?php
class Twitter_Model_Twitter
{
private $_twitter;
/**
* Make the options...
I want to display a table in a Zend Form.
For this i used blow lines
<?php
echo $this->form. $this->partial("staff/medicalTable.phtml");
?>
in application/views/scripts/medical/index.phtml
It works fine. But now I want to display a this table in a Zend Form using an array.
For this i create an array like:
<?php
/**
* Array co...
How do I implement a sidebar in Zend Framework?
I know that I can use a placeholder or something similar in Zend_layout, but how do I automatically generate the code for the sidebar in my controllers without having to call a sidebar class within every controller?
My setup is as follows
Application
- modules
- blog
- other modules
...
I have a controller setup that uses a whole bunch of different AjaxContent helpers.
My init() for the controller looks something like this:
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('index', 'html')
->addActionContext('compose', 'html')
->addActionContext('sent', 'html')
...
Hello,
I m using Zend_Log to create and Log messages.
It works well for storing Log messages in to a stream (a new defined file name), well i want to store these messages in to Buffer array.
For this i visit :
http://framework.zend.com/wiki/display/ZFPROP/Zend_Log+Rewrite#Zend_LogRewrite-1.Overview
but fail to get their points.............
How can I set selected values for a multiselect within my controller?
This is my code so far
class Blog_Form_Post extends Zend_Form
{
public function init()
{
...
$this->addElement('multiselect', 'categories', array(
'label' => 'Categories:',
'required' => false,
...
I have a problem creating an index with Zend_Search_Lucene.
Now, everything works fine on my local machine so I guess there is just an issue with file permissions on the webserver.
Here is how I'm trying to create index in controller:
$index = Zend_Search_Lucene::create('/data/users_index');
Of course the data directory has permissi...
I do not understand how I can send an array with options to my custom filter. Can you please help me?
class Core_Filter_MyFilter implements Zend_Filter_Interface
{
public function __construct($options = null)
...
}
class Blog_Form_Comment extends Zend_Form
{
public function init()
{
$this->setMethod('post');
...
How can I disable string escape in $db->insert, I need to insert html in my database, so I don't want any string escape.Any solutions?
...
Dear All,
I have the following problem. I am learning the Zend Framework. I have written my first simple application, and it works fine. It consists in an index page with some actions to edit a simple database.
Now, I want to add another page: similar structure, different database. I want this second page to be reachable from the firs...
I've recently started using Zend Framework (1.8.4), to provide admin tools for viewing the orders of a shopping cart site.
What I'd like to do is to efficiently create multiple model (Zend_Db_Table_Row_Abstract) objects from a single database result row.
The relationship is simple:
an Order has one Customer (foreign key order_custid...
Hi,
does someone knows how to use the "new" Zend Autoloader to Load Models ? In the Moment my Configuration looks like this :
application.ini
# Autoloader Namespace
autoloadernamespaces.0 = "Sl_"
Bootstrap.php
/**
* Start Autoloader
*
* @access protected
* @return Zend_Application_Module_Autoloader
*/
...
I have been using this, and it works fine in 1.7, but not in 1.8.
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
It says it's deprecated, and that I should use Zend_Loader_Autoloader instead, but I can't seem to get it to work. Any suggestions?
...
Hello,
I have an array in a log.phtml, ie:
<?php
//application/logmessage/log.phtml//
require_once 'Zend/Log.php';
require_once 'Zend/Log/Writer/Stream.php';
class Logger {
/**
* Array variable store full file back trace information.
*
* @access protected
*/
protected $backTrace = array();
/**
* Array variable store full messag...
Hi! I have a problem in my current Zend Framework application.
In my Bootstrap I register these routes:
protected function _initRouter()
{
$this->bootstrap("FrontController");
$frontController = $this->getResource("FrontController");
$route = new Zend_Controller_Router_Route(
":module/:id",
array(
"controll...
Hi!
Because of the problems I experienced here: Zend_ Controller_ Router_Exception: “xyz” is not specified
I want to have this route:
":module/:controller/:id"
and map it onto this:
":module/:controller/:action/id/$id"
Is there any possibility to do this with Zend Framework? I do not want to forward the browser to that URL. I jus...
<?php
class Form_Audience extends Zend_Form_SubForm
{
public function init()
{
$this->setMethod('post');
$this->setLegend('Audience Details');
$this->addElement('text', 'audience_total', array(
'label' => 'Audience Total :',
'required' => true,
'filters' => ar...
I want to add a browse button in Zend_Form to upload Image files..
...
I am a seasoned PHP developer (writing custom apps, templates, CMS, js), but only recently I dived into the world of frameworks like Zend Framework or Cake PHP. The trick is that I am working from home, which means Joomla or Drupal job is easy to find, even if you're a newbie. Which doesn't seem to be the case with ZF, per my initial mar...
Hey, so I was having trouble with decorators, and finally found the ViewScript decorator which seems to be what I'm looking for. I can't quite figure how to get all the files to point to eachother though, and was hoping you guys could help.
In my form, at the bottom, I have my assignment of the viewScript decorator to all my elements:
...