Programmer's Reference Guide
| Erstellen eines Formulars |
Gratulation!
Es wurde eine sehr einfache Anwendung erstellt indem einige der üblichsten Zend Framework Komponenten verwendet wurden. Zend Framework stellt viele Komponenten zur Verfügung welche übliche Anforderungen für Web Anwendungen behandeln, inklusive Web Services, Suchen, PDF's Lesen und Schreiben, Authentifizierung, Authorisierung und viele mehr. Der Referenz Guide ist ein großartiger Platz um mehr über die Komponenten zu erfahren welche man in diesem Schnellstart verwendet hat, wie auch über andere Komponenten. Wir hoffen das Sie Zend Framework nützlich finden - und wichtiger - Spass damit haben!
| Erstellen eines Formulars |
Add A Comment
Please do not report issues via comments; use the ZF Issue Tracker.
If you have a JIRA/Crowd account, we suggest you login first before commenting.

Comments
I've finished the quickstart guide successfully, but I have no clue what I did...
All I want to do is use Zend Framework with a MySQL db that I've already created. Make it as simple as possible. Unfortunately 2 houres on the guide made me only confused...
Mayby I'm wrong and it did help quite a bit, we'll see...
@dreake: I don't think you understand the point of the tutorial.
@Lorcan: perhaps you should learn about the whole MVC concept before trying to work with Zend, or just choose not to use it, as writing plain old SQL queries is much simpler for small scripts.
@Mahmood: you're right, it isn't quick at all, but actually this isn't a "setup guide" but a (quick)start guide. It's intended for programmers who are familliar with PHP programming, OOP, MVC, etc. and want to learn the Zend Framework. Being a tutorial, it's very nice.
Coming from knowing MySql, I got a bit hung up on the sqlite, because I had never used it before. It may be worth mentioning that sqlite is a database that stores data in files, and the files are going into data/db.
Also, it would be helpful to be more clear about where to put the data/db folder, and the scripts folder with the load.sqlite.sql and other files.
Thanks
@dreake ZendFramework is build for large scale projects, this is just an example. To build more advanced features you'll need only few more lines of code. However, if you were working with some other framework this start would be less "painful", but writing additional features and expending your application - I'm sure it would be more complicated.
it's hard to follow and complicated.
ftw. this isn't a quickstart guide.
-
the captcha on this page is buggy. hehe. :)
Unfortunately (for newbies) it's not mentioned at the beginning. Period!
If you are advanced you do not need to read the MVC sh_t on page 1, then you can time-travel past the useless sqlite-magic puzzle (so what? are we now using sqlite for "large scale project" in the future? what do u think?), and finally you end up here in less than 5 minutes to leave this comment:
If this tutorial is for beginners (I can only imagine how much) it sucks!
If this tutorial is for advanced guys it sucks even more (and I can tell as much)!
How did they let you do that?
Once you got your models and mappers done it's a walk in the park.
But its by no means easy to get a blog started unlike some other Frameworks which provide you with a pre-made 'blog' template where you are up and 'running' in 5minutes.
They should really get this down to be for advanced OR beginners and not try to cater both in one tutorial.
On the previous page for GuestbookController the tutorial decides to get rid of the "Index Action()" method:
// snipping indexAction()...
Yet when this is done my application fails. I had to put it back in to work. What was I supposed to do? Thanks
And also, I must not be advanced enough to understand why the captcha on this page is so difficult to match.
In code examples, when someone types 'snipping' or 'snip', that means they are removing that section in their example to make it easier to read. The indexAction code should still be there in your application, so you're right.
Note : for Wamp Server be careful to edit the "..\wamp\bin\apache\Apache2.2.11\bin\php.ini" file and not "..\wamp\bin\php\php5.2.9-2\php.ini" (it's not the first time I mix up the two files...). I had strange results (sometime the include path worked, sometime not)
Oh and the last word : your captcha is crap!
I am an experienced PHP user but I must admit to being somewhat at sea with the Zend Framework at the moment. However, what I have just gone through has given me a (very) basic understanding of the development process; I certainly know more than I did. It has also given me some working code that I can examine at my leisure and tinker with to improve my understanding of what on Earth is going on in there.
The tutorial does need a bit of tidying up, cutting and pasting is messy what with # and numbers getting in the way, and some of the helpful hints from users should be incorporated. Adding MySQL, if not dumping sqlite completely, would make it much more relevant; at least use a DBMS that we are likely to use. I will refrain from making comments beyond this on coding style...
Having said all that, whereas I was totally bamboozled before I started, and thought the Zend Framework impenetrable, I now feel I can get on with it. So I guess you've served me well. Thanks again.
* Fair enough, SQL is not really a database like MySQL but just cos it has the word Lite in the name does not mean its 'bad'
* PHP programming language comes with both SQLite2 and SQLite3 built in - so it makes sense to use it in tutorials
See http://www.sqlite.org/famous.html
I can agree when people don't think this is suitable for beginners - because it's not. ZF is for real programmers, imo ;).
But even if you've got more experience (like I do), it'll occasionally bite you in the ass - both this tutorial, ZF, and the language itself. Some things I ran into:
* Couldn't get the ZF commandline tool to work for a long time (turned out I had the zf.bat file on two locations, both included in my PATH environment variable
* Classes not found, had to add code to the bootstrap (setting up the autoloader) to get things to work (not explained in the tutorial)
* Typos. Defining _construct (with one underscore) will not give you errors or warnings right away, it'll cause errors from the database that state that a field may not be null and things. (PHP / IDE issue)
* Errors in ZF (1.10), the solution being to hand-edit Zend/Tool/Project/Provider/Form.php and add a couple of lines. This would probably be solved with better tests and, gasp, running through the code generated by this quickstart project once before releasing.
I do hope these issues can be sorted out in future releases of the framework (as well as preventing them from happening in the first place), things like these are just frustrating and make me doubt myself ;).
Also, I got a popup saying my comment was entered, but the form itself said the captcha was wrong. Speaking of the captcha, it has some characters that are hard to interpret, like a thing that looks like an angled !.
i'm obviously just learning this but it would have been nice to have the tutorial teach us the remaining CRUD functions (ie update and delete)
next stop, to try it for myself! then, some mashups with google, amazon, yahoo & etc apis etc! yee-ha! cant wait!
one fellow above said he managed to step through all of this Zend Quickstart and afterwards he did not have any clue about what he really did.
That were also my feelings juping into Zend Quickstart the other day. I admire I needed more than half a dozen of hours because of contextual misleadings and also due of my lack of knowledge here and there, of course. But that was not the point.
Zend Framework is the hugest PHP framework in the world and has best perspectives for the future. It is made by Zend, is working with PHP 5, XHTML STRICT, in conjunction with Zend Engine and Zend Server and Zend Studio and Eclipse PHP and and and, so in my opinion Zend Framework just is within the heart of dynamic website programming.
A parable: The other day a man was about to buy a horse at the horse market. A horse dealer promised to him he could go from HERE to THERE within less than 2 hours with the best horse in his stable (which really would be fantastic). "But just why should I go THERE?" the man replied and did not buy the horse. --
So, if you have to build a huge website with thousands of files or pages and several databases, nowadays there is Zend Framework, imagine to do that without any ...
And - most importantly - have fun!
Yours, Micha
one fellow above said he managed to step through all of this Zend Quickstart and afterwards he did not have any clue about what he really did.
That were also my feelings juping into Zend Quickstart the other day. I admire I needed more than half a dozen of hours because of contextual misleadings and also due of my lack of knowledge here and there, of course. But that was not the point.
Zend Framework is the hugest PHP framework in the world and has best perspectives for the future. It is made by Zend, is working with PHP 5, XHTML STRICT, in conjunction with Zend Engine and Zend Server and Zend Studio and Eclipse PHP and and and, so in my opinion Zend Framework just is within the heart of dynamic website programming.
A parable: The other day a man was about to buy a horse at the horse market. A horse dealer promised to him he could go from HERE to THERE within less than 2 hours with the best horse in his stable (which really would be fantastic). "But just why should I go THERE?" the man replied and did not buy the horse. --
So, if you have to build a huge website with thousands of files or pages and several databases, nowadays there is Zend Framework, imagine to do that without any ...
And - most importantly - have fun!
Yours, Micha
Again, depending on the use, devs who may adopt ZF should first consider Content Management Systems and other mature solutions. Don't reinvent the wheel.
TY Zend
TY Zend
The html files are int the templates folder , the modules in a fdiferrent directory, and the database handling - viewing thing in an another. It was very easy to create a new webpage with it, if the customer haven't got many new request .
I'm back again, I took this tutorial as a Zend newbie about 3 months ago. Happy to say I'm working now using this framework and have been really enjoying it. This tutorial helped a little, but I learned pretty much everything from Keith Pope's book "Zend Framework 1.8" and "Easy PHP Websites with the Zend Framework"...
They have great reviews on Amazon, and 'may' be available for downloading on torrents*
*They are
Y a pas un tutorial du style "hello" ?
Malgré la qualité du tutorial, je n'ai pas compris grand chose, ça me semble trop compliqué pour un début. J'ai du mal à comprendre l'organisation des fichiers, où ils sont situés par rapport à ma page index.php.
Vincent
"Take our 30-minute tour" !!! come on guys ... it is a joke !!
I'm not sure If just me or It didn't tell on what path to execute the command.
Good thing is using the SQLite. For some unprivileged windows user this is very helpul. No need to install mysql that need admin permission.
A good thing to add in the tutorial is the putting the framework path in the windows Environment variables. So that It can be executed anywhere.
Looking forward for more fun! Thank you! ZFW :) Thank you Ralph Schindler!
I'm not sure If just me or It didn't tell on what path to execute the command.
Good thing is using the SQLite. For some unprivileged windows user this is very helpul. No need to install mysql that need admin permission.
A good thing to add in the tutorial is the putting the framework path in the windows Environment variables. So that It can be executed anywhere.
Looking forward for more fun! Thank you! ZFW :) Thank you Ralph Schindler!
At first, it wasn't easy for me to follow step by step, sentence by sentence.
However I figure out to put entire source code under proper folder, use my Firefox to play with this guestbook program at local computer. Use Zend Studio to check entire source code and modify something to see what appearance and/or behaviour might change.
Eventually I installed SQLite manager, as AddOn to Firefox. I got a new experience to understand SQLite. I still may have hard time to build new project from scratch, for sure I can use existing structure to start my new project.
The tutorial is manageable. It requires non-trivial knowledge of the OS (Linux, in my case -- I had to hunt-down the library/etc) and a working knowledge of PHP. Both are reasonable prerequisites. However, I've gone through the tutorial and, well, don't feel that I've learned too terribly much. Moreover, the "uphill battle" lies ahead -- learning the classes & methods provided by Zend.
In essence, I more strongly question the value of the ZF, now. Decent programmers are already using OOP, CSS, and include files to get the "scaffolding" and "sharing" provided by ZF. You can even setup templates within your IDE (or have a set of template files to use with vi -- whatever floats your boat). The "extras" that ZF provides (e.g., XSS protection, CAPTCHA, etc) are what's drawn me to ZF... and, well, it might just be easier to bolt those on, manually.
I have to wonder if relying on a framework doesn't incur the hidden expense of stifling one's fundamental language proficiency/etc. YMMV -- just my impression and relatively-uninformed opinion...
what a great satisfaction i had at the end !
Zend rocks !
The formatting of the zf commands are a bit mangled in this tutorial. I expect that people unfamiliar with UNIX will be unable to run some of these commands successfully. Particularly, the database configuration commands are mangled. (Looks like they were copied from a terminal with visible line continuations enabled.) You'd need to understand what you are typing to see how its wrong.
I found that I was able to write and execute my code on the first try without any problems. Most tutorials seem to miss steps which make that difficult.
I would add one caveat and that is if you do make a typo in this tutorial you may be unable to debug it at all. I suspect this is what has left many confused and lost. All you'll get is a 500 error and no record of what went wrong. A simple solution is to add Zend_Log to your ErrorController under the default label so it looks something like this (create a log directory and give the web server write access just like you did for the data/db directory):
default:
// Log the exception:
$exception = $errors->exception;
$log = new Zend_Log(
new Zend_Log_Writer_Stream(
APPLICATION_PATH . '/../log/applicationException.log'
)
);
$log->debug($exception->getMessage() . "\n" .
$exception->getTraceAsString());
// return an error response
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
break;
The application is nice but I have no clue what I just did.. That wasn't the case with CakePHP
Sorry guys, you have lost me.
If say about PHP framework I prefer CodeIgniter.
P.S. And WTF? Why I should write accessors in model by hand? Today every framework generates them automatically.
So thanks for the tutorial. For the general crowd I think an explaination of how to use mysql instead of PDO would be more interesting.
A bit too much for a "quick start", but anyway I managed to get to the "congratulation" part in about 2 hours, and I can say that the big picture seem a bit more clear now. thanks!
p.s. a "quicker quick start guide" might not be a bad idea...
Of course if you need a framework for your project it is understandable that you have a good base of knoledgment for developping all the stages of the cicle.
I see a lot of capabilities into Zend Framework.
Are You guys joking? "
is totally true.
I think that the tutorial is quite clear.The only part i had problems with was the part of Create a Model and Database table, in that part the commands zf configure db-adapter didn't work for me.
I think that the Zend Group tutorial creator should rewrite that part again connecting to a Mysql Database, because with MySqlite doesn't recognize the dsn dbname.
Well, thanks anyway.
Geetings from Peru :)
Well, until finally I could run the tutorial, I take more than 3 days to do so. U_U
All I can say, this tutorial only gave me a basic idea of what it proposes zend, as read out there, this tutorial on symfony consist of a page. Anyway, things zend.
Greetings people from Lima - Peru .. =D
zend rules ...!!!
installing and setting everything up took me some time.
Some issues I had:
- Standard zend server Ubuntu package installation came with a lot of problems, especially because of missing PHP libraries I couldn't install.
- Uninstalling default PHP packages for the Zend ones really makes me angry! ;-)
I finally installed the .tar.gz and voilà. It worked.
What didn't work as expected or missing in the tutorial:
- VirtualHost configuration should be put in the httpd-vhosts.conf file, which is in the /usr/local/zend/apache2/conf/extra/ directory.
After that, edit httpd.conf and uncomment the line loading that file.
- The SQLite database loading stuff didn't work. I had to create the ".db" by hand and insert schema and data.
Don't forget to set correct permissions (try world-writable for testing, make it owned by the php / webserver user in production)
- Zend Studio is... poor(ly featured).
I'm working with IntelliJ now, and it's really good.
I'm more accustomed to it than Eclipse, that could be a reason, but common "THE Zend Framework IDE" doesn't even can autocomplete class names (Application_*) and has no syntax coloring in the *.ini file ?!
The "bit" tricky part in IntelliJ (or any other IDE because it's a matter of php.ini & apache) was to setup XDebug, but once you have done it, it works for all PHP projects.
Apart from that, as soon as you've started, the framework really shines and you realize installation time was well spent and was worth it.
However, compared to what you usually have to setup with Java Web projects, this is really nothing, and much simpler than most frameworks (Spring, Struts, JSF, Persistence : Hibernate and his friends / JPA).
This is definitely not helpful for beginners... if anything, it makes things even more confusing.
There is nothing wrong with this tutorial, only those following it.
For example... 'zf create form Guestbook' basically saves me a few lines of typing. This might be good for me as a beginner, but I would imagine that after I wrote x number Zend projects, it would be like second nature to write that zf generated code. Maybe the form data was a bad example as the script can't predict what type of input fields I want, but it feels like there could be more 'meat' generated in the classes/functions. Take the GuestbookMapper as another example...
For how much code is represented in the tutorial (getDBTable, setDBTable, etc)... generating the following with zf
class Application_Model_ParentMapper
{
}
basically saves me nothing.
Just curious, but when you work with the framework for a while, do you still use zf to generate your files?
Good tutorial but not for beginners.
I must say, I spent 50% of the time reverse engineering the tutorial itself:
mostly on the db setup page.
Thanks for the effort, one or two more passes to make this more streamline - and specifying things like where the data directory and script directory should go might help to shave off a couple hours and endless frustrations.
hope the learning curve to understand more advanced usage is not too steep...
I must say, I spent 50% of the time reverse engineering the tutorial itself:
mostly on the db setup page.
Thanks for the effort, one or two more passes to make this more streamline - and specifying things like where the data directory and script directory should go might help to shave off a couple hours and endless frustrations.
hope the learning curve to understand more advanced usage is not too steep...
I've been able to solve all of them thanks to the comments, but it would be much less frustrating if they wouldn't be any fatal errors in the first place.
The installation (on OS X 10.4 ppc) had a few hiccups, but everyone must realize that "unix-like" systems are far from uniform in the way the os is organized and different parts 'talk' to one another -- notably with regards to paths. This is a real weak point (and not just in Zend Framework), and could be better addressed in the documentation, as many key details are assumed, overlooked, and (in a few cases) factually wrong.
There are more than a few syntactical head-scratchers, e.g. why do so many of the individual tutorial files (supplied in the download) have opening, but not closing "<? php" tags -- yet invariably, in the online tutorial, all such tags are omitted?
My take on this project is that it is a shrewd and necessary step by Zend to protect php market share from the avalanche of MVC frameworks that gained incredible traction through ruby/rails and have extended to other scripting languages including asp.NET.
It's reassuring this effort has the power of the venerable PHP -- and Zend -- behind it, but far from assured the actual quality of this effort will be enough. Better documentation and more advanced tutorials are needed.
I would like to see better documentation, and
About all the comments on using sqlite instead of mysql (which we all know by heart of course): well it made me learn something (kinda the point of a tutorial, no?). If you didn't have a clue of what sqlite was, maybe consider googling it, ... or something.
About the quickness of this tutorial: most times I got stuck on something, it turned out to be a Windows / WAMP issue. So shoot MS, not ZF.
Can't wait to dig a little deeper.