Category Archives: PHP

Setting Up a Specific Layout for a Zend Action

Now that’s really simple! In your action method simply add this line: $this->view->layout()->setLayout(’embed’); Thus the code will look like so: <?php   class IndexController extends Zend_Controller_Action { public function indexAction() { $this->view->layout()->setLayout(’embed’); // … } }

Posted in micro tutorial, PHP, zend framework | Tagged , , , | Leave a comment

One Form – Multiple DB Records

I’ve the impression that even it’s a simple technique it remains quite misunderstood! What’s the Goal? You’ve a simple HTML form with several groups of form elements. Imagine the situation with title and link groups. You can have 1, 2 … Continue reading

Posted in PHP, web development | Tagged , , , , , , , , , | Leave a comment

PHP: Conditionals Coding Style

Just to continue with PHP coding style, let me suggest a conditional statement coding standard. Just don’t use large three operands conditions like that: condition ? if_true : if_false If it’s too long it will be difficult to read and … Continue reading

Posted in PHP | Tagged , , , , , , , , | Leave a comment

Download Files with Zend Framework

Download a File The title may sound unclear enough, but the task is simple. You’ve to make a file download process within a Zend Framework’s controller. Let’s assume we’ve the DownloadController setup: <?php   class DownloadController extends Zend_Controller_Action { public … Continue reading

Posted in micro tutorial, PHP, zend framework | Tagged , , , , , , , , , | 4 Comments

PHP Coding Style: Large IF Statements

Have you ever seen some PHP code like that: 1 2 3 if ($condition1 && $condition2 && $string1 == $string2 . $string3 && $string4 != $string5 . $string6) { // write some code here!? } It is ugly, isn’t it? … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , | Leave a comment