Welcome Guest, Not a member yet? Register   Sign In
Bought Adam Griffiths Book, am using his Library, Have questions
#1

[eluser]Chris Bruner[/eluser]
This post has to do with Adam Griffiths book, in particular the Auth library which the book says is available from his site. I didn't realize that his forum was the codeigniter forum.


First, the sample code in the library has as the first input field
Username/Email
But when entering the email it says username not found.

shouldn't it attempt a lookup by email if username wasn't found?

Second the form error echos paragraph tag
Code:
<p></p>
around the error, which causes the error to appear on the next line. I would like it to appear beside the input field. I would also like the font of the error to be red in order to stand out. How do I do this?

Third, I've been trying to follow your code flow. It appears to me that you are trying to make things easier for the programmer by doing things for them, but not having any explanation of what it is you are doing. For example what is $auth as in

Fourth, in the book it says that there is a method for "remember me next time" but the example doesn't have that. How do I do that?
Code:
$this->auth->view(login);

Looking into your code you are setting tables and all sorts of stuff, that I don't understand why you are doing it, what do tables have to do with logging in?
#2

[eluser]Chris Bruner[/eluser]
Replying to myself.
Auth is the library that Adam has made.
The reason I'm so confused is that in the Library it calls views and controllers. This breaks the M-C-V model.

So the layout is, the Controller calls the library which calls the view. To set your own variables to be displayed in the view (for example the number of users logged on) you actually need to change the library.

The views themselves call other views, which isn't so bad. However my style has been that the controller, calls the views. That is, the controller calls the header view, the menu view, the body view, the footer view.
#3

[eluser]JamieBarton[/eluser]
Yeah his book that covers the Auth, the Auth doesn't work for me at all.




Theme © iAndrew 2016 - Forum software by © MyBB