0
I wonder if you have the possibility to change a parameter of the url with codeigniter. I have a function created called edit and in it I pass the id of the client to be edited, only that in place of the id that is the parameter, I would like to be shown the name of the client, there is this possibility?
Follow code to analyze:
public function editar($id)
{
$data = array();
$data['NOMECLIENTE'] = '';
$data['IDCLIENTE'] = '';
$cliente = $this->ClienteM->get(array('id_cliente' => $id), TRUE);
if ($cliente) {
$data['IDCLIENTE'] = $cliente->id_cliente;
$data['NOMECLIENTE'] = $cliente->nome_cliente;
}
setURL($data,'cliente');
$this->parser->parse('painel/cliente_form', $data);
}
Your doubt is not clear. Where does this method come from
setURL
? You want the name to appear where? In the link or as a link attribute?– ShutUpMagda
Hello Shutupmagda the setUrl method and a helper created to define some actions like list and save, I want the name to appear in the url instead of the id parameter
– PaulinhoCaP
as the edit link is being generated?
– RFL
The code you posted does not do what you describe. What this code does is to fill in a
array
and carry aview
on the basis of$id
sent via$_GET
. It is possible that these links are being generated withsetURL
, But you don’t show what she does, so it’s hard to help. In addition to showing the function, you should put an example of how the URI is getting and how you want it to look. After all, what is the reason for replacing the id in the URI?– ShutUpMagda