Zend Framework Tutorial

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Zend Framework Tutorial

Post by shiznatix »

Ok, yes, I have googled it. Thats the problem, there is nothing concise and to the point. I am looking for tutorials to get me started using Zend Framework but everything out there is so scattered and skips basic questions. Questions I have:

How to set variables that will be used in your "view" from your controller (obviously). I have this:

Code: Select all

$tmp = Zend_Loader::loadClass('Zend_View');

$tmp = new Zend_View(array('scriptPath' => 'views/scripts/'));

$tmp->test = 'werd';

echo $tmp->render('index.phtml');
But that just gives me an error about unable to find the file even though it is there. Frustration levels are high.

Next is how to setup a database connection. I have tried all examples I have found, none seam to work because whenever I try to load something from a model class that extends Zend_Table (or whatever it is), I get an error. I googled the error and none of the fixes worked so I scraped it. I just want to be able to be able to connect to the db though the bootstrap and use a model in my controler like so:

Code: Select all

$users = Zend_Loader::loadClass('Users');
$users = new Users;

$all_users = $users->loadAll();//or something like that
and also, I would like to load all of my classes in the __construct but this does not seam to work because if I give one of my controllers a construct Zend dies. Frustration levels++

There are some other things but these are the most basic for right now. Sorry I don't have all of the "I tried these examples" links but they have been lost in the confusion of everything I have tried. They are the basic first hits on google.

Maybe I am just using the wrong framework? Is there something better?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

The one I used was Akrabat Zend Tutorial. Wouldn't say it answers all questions but gets you started on the basic MVC.
Post Reply