Welcome Guest, Not a member yet? Register   Sign In
shold I move this code in my .config file??
#1

[eluser]zoreli[/eluser]
Hi
I am fairly new with CI, and I have a question.

I have the following code in my controller at this time:

Code:
$config['upload_path'] = '/Library/WebServer/Documents/ciAdmin/backOffice/backOfficeImages/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2048';
$config['max_width']  = '1024';
$config['max_height']  = '768';

The code works, and I have no problem with it whatsoever. However, I read that is good practice to have skinny controllers, so therefore my question.

I think that I should move this code in config file, but how I should access it from my controller later? Also, I might have more config variables for videos for example or pdf files.

How should I name my variables to avoid confusing? Can I use other name instead of $config?
For example can I use the name $configImage here instead of config in the above example?

Regards, Zoreli


Messages In This Thread
shold I move this code in my .config file?? - by El Forum - 02-20-2012, 09:12 AM
shold I move this code in my .config file?? - by El Forum - 02-20-2012, 01:02 PM
shold I move this code in my .config file?? - by El Forum - 02-21-2012, 03:28 AM
shold I move this code in my .config file?? - by El Forum - 02-21-2012, 07:17 AM
shold I move this code in my .config file?? - by El Forum - 02-21-2012, 09:55 AM
shold I move this code in my .config file?? - by El Forum - 02-21-2012, 01:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB