For the purposes of styling I have the need to put an opening <div> at the beginning of one element, and a closing </div> tag at the end of another. Looking over the docs for HtmlDecorator I can't seem to figure out how to get it right, or if this is even the right decorator to use. It seems wasteful to have to create my own decorator si...
I have a controller and action which I'm accessing through a custom URL. The original route is still accessible though at the default location
zend.com/controller/action
How can I change this to simulate a "Page not found" when the user tries to access this URL? Is it possible?
...
I'm working on a small website and need to display blocks of static text on the front page. These blocks will be styled later as paragraphs or bullets and so on.
Where do you suggest I store this text? Do they go as variable in each view where they are used? I could do that, but I'd prefer to have a central location for all this text.
...
Hi there,
I have the following setup:
An endless running PHP process that looks at a job queue which contains module names, controller names, action names and a parameter array.
For every job I want to call the given controllers action and retrieve the rendered view for further processing.
I was thinking about bootstrapping an instan...
I am facing strange problem. I have form which has lots of hidden field and text field and one file field. And there are total six fields for selecting tagging on file which is to be uploaded.
When user select less parameter or less tags then form get submitted properly.
but when user select more parameters in all six fields and submit ...
Hello, i'm a bit confused about modules, namespace and reflection.
$obj = new default_Model_foo();
$obj->bar();
The code above runs properly, but i need to add reflection;
I've got these variables:
$moduleName = "default";
$modelName = "foo";
$function = "bar";
I would like to instantiate a class at runtime, how can do it?
Tha...
Hi. I have the following code inside my controller but I can't open the pdf it produces.
$html = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head><body>trial</body></html>";
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
...
Hello,
I would like to change the default behavior of Zend_Form, so that whenever the submit button is clicked, form submission is prevented and an arbitrary JavaScript function is called. This would be done for all forms on the site, however the actual JS function to call may change from form to form.
What would be the most proper way...
I am using zend framework v1.9.6 and written a piece of code in preDispatch method of one of the controllers as
if(!isset($_SESSION['myvar']){
//do something and assign a value to the session variable
}
..so that the code executes only once.
However I am getting a fatal error at the end of the page everytime except for when th...
I am trying to serve up my user repository via zend_json_server. The problem is the service is returning empty objects. What have i missed?
server side:
$repo = App_User_Repository::getInstance();
$server = new Zend_Json_Server();
$server->setClass($repo);
if ('GET' == $_SERVER['REQUEST_METHOD']) {
$server->setTarget('/ser...
I have a folder that contains uploaded documents that my ZF application can spit out to logged in users. I want them to be able to use a link like http://server/documents/filename.pdf and download the file, but I want to have a controller DocumentsController that enables the existing user cookies to verify that they are logged in and hav...
In my entry controller I set:
This works:
$authadapter = new Test_Auth_Adapter_DbTable($db);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authadapter);
$data = $authadapter->getResultRowObject(null, 'password');
$auth->getStorage()->write($data);
$this->_redirector->gotoUrl('/main');
This does not:
$authadapter ...
How to save answers from path mapping dialog? Now, always, I need to choose about 10 files before I can start debugging my Zend Framework application. It's really irritated. I found something interesting in Window -> Preferences -> PHP Servers -> Edit -> Path Mapping but I don't know how to use it. :-( I have my Zend library in "/usr/loc...
In the Zend Framework library, the current practice (circa 1.10.8) is that library components throw exceptions that extend Zend_Exception.
E.g. the Zend_Layout component throws a Zend_Layout_Exception
In my own ZF library, where I'm adding my own ZF components or extending existing components, I'm throwing a Mylibrary_Exception (it's...
Hi,
I am trying to add a field via a subselect but cant figure out how to format the subquery in Zend DB. E.g. in MySql it looks like this:
SELECT a.columnA, b.columnB,
**(SELECT c.columnC FROM tableC c WHERE c.test = 1) AS total**
FROM tableA AS a
INNER JOIN tableB on b.id = a.id
The Zend DB format is:
->select()
->from(array('a'=>...
I want to find out common days/dates between two periods for example [period1 - 25/10/2010 - 25-11-2010 ] and [ period2 - 10-11-2010 - 10-12-2010 ]...here 15 days 26-10 to 10-11 are common....how can I find it in PHP or Zend Framework..... Thanks in Advance......
...
Hi,
I am a great fan of Zend framework and somehow i have modified it in my own way.
I have been using it from around a year but still i lack knowledge of some internal workings.
So i decided to design my own framework to understand inner things.
I just want from you guys to provide resources about it, articles, tutorial or any book.
I...
Hi all,
I've got a question regarding sub forms.
Currently I've got 2 sub forms and one parent form. On one of the sub forms I want to get data from the model and this needs to be displayed in a table, the first column needs to have a radio button as I want to know which row has been selected. But as a table isn't a form element how ca...
Hello gurus!
i've picked up zend framework and being playing with it, and here is a situation i'll like to
achieve.
i have default and user modules, user has a different layout user_layout that i load in predispatch of NovelsController of user modules.i have a small form in the user_layout that post dates (from and to ) to showAction...
I have a function like the following:
public function foo ($cities = array('anaheim', 'baker', 'colfax') )
{
$db = global instance of Zend_Db_Adapter_Pdo_Mysql...
$query = 'SELECT name FROM user WHERE city IN ('.implode(',',$cities).')';
$result = $db->fetchAll( $query );
}
This works out fine until someone passes $cities...