CI total newbie topic |
[eluser]bretticus[/eluser]
[quote author="keevitaja" date="1282914346"]this code gives me the error while loading the database[/quote] Gives you what error? Do share, please.
[eluser]keevitaja[/eluser]
controllers/admin.php Code: <?php libraries/simple_auth.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); http://localhost/site/index.php/admin/login Quote:An Error Was Encountered what am i doing wrong? other libraries, like email, do not give the error!
[eluser]keevitaja[/eluser]
oops... Quote:Note: The Database classes can not be extended or replaced with your own classes, nor can the Loader class in PHP 4. All other classes are able to be replaced/extended. so how can i use database in my own libraries? edit: think i got it! i have to use model in order to interact with database inside custom library...
[eluser]davidbehler[/eluser]
Not necessarily, this should work aswell: Code: $this->ci->load->library('database');
[eluser]keevitaja[/eluser]
how to get the called class if the model is allready extended... Code: <?php i need to get the name of the last class 'Final' for some db methods like create, update, delete etc. don't want to write them each time. in order that to work, i have to autoload main_model but this main model is actually abstract and i call methods from Final
[eluser]keevitaja[/eluser]
and a question about form_validation. in my login form if the username and/or the password are not validating, then is it possible to display error message like the form_validation works with rules... RESOLVED
[eluser]keevitaja[/eluser]
if the form doesn't validate, i can only call a function where form was sent in order to get the error messages. i would like to redirect the page... Code: function index() { in that case i don not get the errors... is it possible to fix it? i like to let people refresh the page without sending the form data again!
[eluser]keevitaja[/eluser]
can controllers be stored in a subfolder and then call like http://mysite.com/subfolder/controller ?
[eluser]WanWizard[/eluser]
Yes. With the restriction that you can't have a folder and a controller with the same name. So if you have: test1.php test1/test2.php then you can never load the test2 controller, as CI looks for a matching controller first, and only for a folder if the controller isn't found.
[eluser]keevitaja[/eluser]
this is strange. i tested to put controllers in separate folder and it didn't work. now it works... probably made mistake first time |
Welcome Guest, Not a member yet? Register Sign In |