[eluser]Sumon[/eluser]
To reduce code i use one technique which might help you save your time. For that i use a common class (inside system\application\libraries)
Code:
class Custom_config extends Controller
{
function Custom_config()
{
//parent::Controller(); //Strictly Prohibited.
}
function RestoreControl($_POST)
{
global $Data;
foreach($_POST as $Key=>$Value)
$Data[$Key] = $Value;
}
}
here is my controller use these functions
Code:
class Photo extends Controller
{
function CreateAlbum()
Custom_config::InitializeTextBoxControl(array('album_title' , 'album_location' , 'album_description' , 'UploadMessage' , 'Message'));
//album_title, album_location, album_description, UploadMessage, Message = these are view text boxes name
//Say here is your validation codes......
//after validation for invalid case you need to restore your control values
global $Data;
Custom_config::RestoreControl($_POST); // repopulated common fields value
}
I think it might be helpful and please lets discuss further.