[eluser]Saymont[/eluser]
Thank you for reply Pyromaniac.
Your code was very useful to understand the main idea but I have an error:
func_get_args(): Can't be used as a function parameter in .....
the line is:
Code:
$dir = func_num_args() > 0 ? implode('/', func_get_args()): "/" ;
All my function is:
Code:
function ftp()
{
// carrega modelo
$this->load->model('Centralmidia_ftp_model');
$this->load->library('ftp');
$carrega_ftp = $this->Centralmidia_ftp_model->carrega_ftp();
foreach($carrega_ftp as $row)
{
$config['hostname'] = $row->ftp_servidor;
$config['username'] = $row->ftp_usuario;
$config['password'] = $row->ftp_senha;
$config['debug'] = TRUE;
$config['port'] = 21;
$config['passive'] = FALSE;
$config['debug'] = TRUE;
$ftp_url = $row->ftp_url;
}
$this->ftp->connect($config);
//$diretorio = $this->Centralmidia_ftp_model->diretorio_ftp();
$dir = func_num_args() > 0 ? implode('/', func_get_args()): "/" ;
$list = $this->ftp->list_files($dir);
$data['ftp_url'] = $ftp_url;
$data['list'] = $list;
$this->load->view('admin/ftp/listagem_view',$this->_comum($data));
}