I need to implement a function called 'learn skill'. In the controller i added this code:
public function learnskill( $character_id, $skillname )
{
$this->load->model('skillfactory_model');
// Ideally i would need that the factory returns the model
// skill_parry_model so i can use it
$skill_instance = $this->skill_factory_model->create($skillname);
$skill_instance->learn($character_id);
}
How can i implement the model 'skill_factory_model' and how i can write the controller and follow CI guidelines?