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?
Hi Alexander, i am having the problem, I have done all the code but the login panel is not showing in login page. the source code it shows in explorer is:
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.
Some how my application cant seem to find the form. it simply returns me the error:
Fatal error: Class 'Form_LoginForm' not found in Z:\PHP\xampp\xampp\htdocs\zendframework\Test\application\controllers\AuthenticationController.php on line 18
is because in the video he never talk about Bootstrap.php just add code below and put an invalid password in your controller: protected function _initAutoload() { $moduleLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => '', 'basePath' => APPLICATION_PATH)); return $moduleLoader; }
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 love these tutorials and you explain them very well :)
willzurmacht 5 months ago
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?
plasticcuppro 5 months ago in playlist Zend Framework 1.9 tutorials
Great tutorial - thanks.
EoN604 10 months ago
This has been flagged as spam show
Hi Alexander, i am having the problem, I have done all the code but the login panel is not showing in login page. the source code it shows in explorer is:
<f0rm enc type="application/x-WW W-f0rm-URL encoded" acti0n=""
invalid
i dont know why it is so. i have done complete code as u described in tutorial plzzz help me i am stuck here plz....
07105006 10 months ago
Comment removed
07105006 10 months ago
Comment removed
07105006 10 months ago
Comment removed
07105006 10 months ago
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
Comment removed
07105006 10 months ago
Zend_Controller_Front::getInstance()->getBaseUrl() returns to nothing. How can I fix it.
Im using Ubuntu 10.04 and ZF 1.10
truonglq1985 1 year ago
Can you write an update for
$identity = $authAdapter->getResultRowObject();
$authStorage = $auth->getStorage();
$authStorage->write($identity);
for 1.10 because it login but it don't save sassion
lucian0308 1 year ago
my form didn't appear either...
and i have the code in bootstrap ..
What can it be?
xdyex 1 year ago
Sorry! My mistake
Excelent tutorials! Thank you!
xdyex 1 year ago
Some how my application cant seem to find the form. it simply returns me the error:
Fatal error: Class 'Form_LoginForm' not found in Z:\PHP\xampp\xampp\htdocs\zendframework\Test\application\controllers\AuthenticationController.php on line 18
DirkZz 1 year ago
I've been following this, but for some reason my form will not appear.
metropolisiii 2 years ago
is because in the video he never talk about Bootstrap.php just add code below and put an invalid password in your controller: protected function _initAutoload() { $moduleLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => '', 'basePath' => APPLICATION_PATH)); return $moduleLoader; }
medthompson 2 years ago
@medthompson thanks, it works now :)
christinio 1 year 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
Thanks for clearing that up for me in a fast reply :)
And many thanks for the tutorials, they're awesome!
christinio 2 years ago