Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2010-05-24 02:06:59

rafaelcavalcanti
New member
From: Brazil
Registered: 2010-03-09
Posts: 5

Method development with Zend Framework

Hello, how are you?

I have studied Zend and Doctrine and would like to clarify a doubt with you if possible.
With the priority always get the idea of not repeating code. In my projects I see that every controller has the basic CRUD.
What you have as an ideal to display a list of captured data from the database?
I've created two classes that make this process but I am still not satisfied.

And what is his method of project development in working with zend module to avoid repeating code and leave a cleaner, faster programming?

Offline

#2 2010-06-15 00:52:39

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: Method development with Zend Framework

hey Rafael,

I think there's some great tricks for cutting down repetition in PHP by using reflection.

for example, you can call methods like this:

$obj = new "My_Prefix_".$objName();
$obj->$property = $someValue;

often times in frameworks like Zend and Doctrine, you're writing a lot of mapping / wrapping code. dynamic property assignment and object creation can really help you in those instances.

I'll be putting a video together about this soon!

Hope that helps,
-
Jon

Offline

Board footer

Powered by FluxBB