Zend Framework 1.8 tutorial 4 zend_auth and zend_form part 3
Loading...
15,644
Uploader Comments (integral30)
see all
All Comments (21)
-
I love these tutorials and you explain them very well :)
-
Wouldn't it be a better practice to write the AuthInstance as follows:
$auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { // redirect } // show form / check form submission
It make the code cleaner and more readable. While you are technically correct, Zend_Auth will only be referenced once, wouldn't it be better practice to only put one reference to it?
-
Great tutorial - thanks.
Loading...
Ok Solution for
Fatal error: Class 'Form_LoginForm' not found in Z:\PHP\xampp\xampp\htdocs\zendframework\Test\application\controllers\AuthenticationController.php
Please check ur folder is named as 'forms' instead of form in application directory.
07105006 10 months ago
@07105006 that can be so many things... for starters check your namespace. Check either your bootstrap or config.ini or directive appnamespace = ""
integral30 10 months ago
why do you pass a boolean to setRequired once and once not?
christinio 2 years ago
To illustrate how zend validator works; in this example what happens if user does not enter a value in the field that is set to setRequired.
integral30 2 years ago
Erm but the result of
setRequired() and setRequired(true) in this clip is the same, isn't it? is there a difference?
christinio 2 years ago
Oh so thats what you ment, Sorry.
Yes, there is no difference. The default parameter for setRequired is always true so setRequired() and setRequried(true) is the same. setRequired(false) would then be equivalent of not having setRequired at all.
I should have been consistent to avoid confusion.
integral30 2 years ago