Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Robert Basic's Blog:
Grouping Zend Framework controllers in subdirectories
Apr 18, 2011 @ 14:08:25

Robert Basic has a new post today showing you how you can group your controllers in your Zend Framework application into subdirectories for easier organization.

Thanks to a discussion on the Zend Framework mailing list I learned about a new feature, a feature that allows for grouping action controllers in subdirectories! Well, this is more of an unknown and undocumented feature than new, as it is the part of the framework for at least 3 years. Why am I so hyped about this? Because it allows for better code organisation on larger projects. Heck, it might be useful on smaller ones too.

He gives an example of how it might be laid out and a few helpful hints he learned when trying it out:

  • The subdirectory separator in the URI is the underscore and not the slash.
  • The subdirectory name is uppercase: Subdirectory, not subdirectory. In the URI it's lowercase.
  • The view directories for these subdirectories are lowercased, and not uppercase.
tagged: zendframework controller subdirectory group

Link:

SaniSoft Blog:
Help! vendor() is deprecated.
May 12, 2008 @ 14:35:48

On the SaniSoft blog today, Tarique Sani has a quick hack for CakePHP users needing to transition over from the deprecated vendor() call - import().

Use of vendor() function to load third party libs in CakePHP has been deprecated for some time now... It has been replaced with the more generic App::import() the usage is simple.

There's also a little trick you'll need to know for files with underscores (drop it and replace with an uppercase) and how to get it to be a bit more flexible and recognize vendor files in subdirectories or ones differently named.

tagged: vendor cakephp framework deprecated trick underscore subdirectory

Link:

Antoine Ughetto's Blog:
Easy way to find a file in subdirectory with php
Feb 18, 2008 @ 17:15:00

Antoine Ughetto has posted an easy way to find a file inside any series of subdirectories with PHP:

I've made a previus post on SPL using RecursiveIterator to parse Array. Today we will use this same RecursiveIterator with a DirectoryRecursiveIterator.

The code is pretty simple and straight forward - a DirectorySearch class that takes in the directory name and recurses through the files and subdirectories to locate the file you're looking for.

tagged: directoryrecursiveiterator find file subdirectory

Link:

The Bakery:
LightTPD and CakePHP setup in subdirectories
Jan 18, 2007 @ 16:04:00

In this new tutorial over on The Bakery, Anton Bobrov walks you through a process he discovered to get LightTPD and CakePHP setup in a subdirectory on his site.

I faced the challenge to install CakePHP under LightTPD. All works smoothly as long as I deploy projects in document root of domain. But when I want to setup CakePHP in subdir all goes wrong.

Basically, the tutorial involves changing some configuration options in the lighttpd to help it understand the correct routing for the CakePHP application. He even includes a download of the updates to make a drag & drop upgrade easier.

tagged: lightthpd cakephp framework subdirectory configuration lightthpd cakephp framework subdirectory configuration

Link:

The Bakery:
LightTPD and CakePHP setup in subdirectories
Jan 18, 2007 @ 16:04:00

In this new tutorial over on The Bakery, Anton Bobrov walks you through a process he discovered to get LightTPD and CakePHP setup in a subdirectory on his site.

I faced the challenge to install CakePHP under LightTPD. All works smoothly as long as I deploy projects in document root of domain. But when I want to setup CakePHP in subdir all goes wrong.

Basically, the tutorial involves changing some configuration options in the lighttpd to help it understand the correct routing for the CakePHP application. He even includes a download of the updates to make a drag & drop upgrade easier.

tagged: lightthpd cakephp framework subdirectory configuration lightthpd cakephp framework subdirectory configuration

Link:

Ligaya Turmelle's Blog:
Quick snip (or Zend Framework in a Subdirectory)
Dec 06, 2006 @ 15:44:00

As Ligaya Turmelle discovered when trying to work with the Zend Framework in a subdirectory, it doesn't want to play nice. After poking around a bit, though, she discovered a solution in the Zend_Controller_RewriteRoute package.

I am using a subfolder of web root to play with the ZF and was having troubles getting my controller to go to the correct place. After considering hacking both the Apache doc root and the actual Zend_Controller_Router code and writing a patch, I stumbled on the answer - Zend_Controller_RewriteRouter.

She includes the quick code that acts as a patch for the framework, letting it know that the directory it should be rewriting to isn't the root of the domain.

tagged: zend framework subdirectory rewriterouter rewritebase router zend framework subdirectory rewriterouter rewritebase router

Link:

Ligaya Turmelle's Blog:
Quick snip (or Zend Framework in a Subdirectory)
Dec 06, 2006 @ 15:44:00

As Ligaya Turmelle discovered when trying to work with the Zend Framework in a subdirectory, it doesn't want to play nice. After poking around a bit, though, she discovered a solution in the Zend_Controller_RewriteRoute package.

I am using a subfolder of web root to play with the ZF and was having troubles getting my controller to go to the correct place. After considering hacking both the Apache doc root and the actual Zend_Controller_Router code and writing a patch, I stumbled on the answer - Zend_Controller_RewriteRouter.

She includes the quick code that acts as a patch for the framework, letting it know that the directory it should be rewriting to isn't the root of the domain.

tagged: zend framework subdirectory rewriterouter rewritebase router zend framework subdirectory rewriterouter rewritebase router

Link:

Dmytro Shteflyuk's Blog:
Zend Framework - Router for subdirectory-based site
Mar 08, 2006 @ 13:36:39

Dmytro Shteflyuk has posted some his his experiences with the Zend Framework already, specifically in dealing with subdirectory issues.

I started discovering of Zend Framework and was confronted with a problem. When I've placed my test sample into site's subdirectory (http://localhost/test/), default router tried to find TestController which is not exists of course and routed me to IndexController/noRoute. It's not good for me. I decided to create my own router.

He gives the code he created to make the routing system work, using the Zend_Controller_Router_Interface and Zend_Controller_Front packages to handle the incoming requests.

tagged: zend framework router subdirectory site zend framework router subdirectory site

Link:

Dmytro Shteflyuk's Blog:
Zend Framework - Router for subdirectory-based site
Mar 08, 2006 @ 13:36:39

Dmytro Shteflyuk has posted some his his experiences with the Zend Framework already, specifically in dealing with subdirectory issues.

I started discovering of Zend Framework and was confronted with a problem. When I've placed my test sample into site's subdirectory (http://localhost/test/), default router tried to find TestController which is not exists of course and routed me to IndexController/noRoute. It's not good for me. I decided to create my own router.

He gives the code he created to make the routing system work, using the Zend_Controller_Router_Interface and Zend_Controller_Front packages to handle the incoming requests.

tagged: zend framework router subdirectory site zend framework router subdirectory site

Link:


Trending Topics: