Use one time library instead of two time |
[eluser]kolxoznik1[/eluser]
As I understand correctly from this code I ask one time "image_upload" if have error and two time when everything is ok! so first time I check for error and the second chtck / get data to variable. Is there a chance to check for error and if no get data, not to ask two time? Code: if (!$this->image_upload_lib->image_upload($config)) { Just want to improve my code and get more knowledge. Thank you !
[eluser]Aken[/eluser]
Since "image_upload_lib" is not a standard CI library, can't really say for sure what's correct for it specifically. But that's pretty redundant code - you should perform the upload once, then check if it was successful. The CI File Upload library has an example of how it handles uploads. |
Welcome Guest, Not a member yet? Register Sign In |