Reputation: 1
I am trying this, but it does not work.
echo "<a class='btn btn-info btn-md' href='<?php echo base_url();?>index.php/Welcome/editvendor/$row->VendorId'>Edit</a>";
URI does not get loaded.
Upvotes: 0
Views: 333
Reputation: 809
Try this:
echo "<a class='btn btn-info btn-md' href='".base_url()."index.php/welcome/editvendor/".$row->VendorId."' > Edit </a>";
Upvotes: 0
Reputation: 1461
If you default controller is welcome
(in /config/routes.php $route['default_controller'] = "welcome";
), then your links should look like this when you use base_url()
:
"<a class='whatever' href='". base_url() ."'editvendor/'".$row->VendorId."'>Edit</a>"
Upvotes: 0
Reputation: 38652
Your echo
statement should be
echo "<td> <a class='btn btn-info btn-md' href='". base_url() ."'index.php/Welcome/editvendor/'.$row->VendorId.'">Edit</a></td>";
Then in config/config.php
$config['base_url'] = '';
$config['index_page'] = '';
And in config/autoload.php
$autoload['helper'] = array('url');
Upvotes: 0
Reputation: 1868
try this
<td> <a class='btn btn-info btn-md' href="<?php echo base_url('index.php/Welcome/editvendor/'.$row->VendorId); ?>">Edit</a></td>
Upvotes: 0
Reputation: 3935
Use
echo "<td><a class='btn btn-info btn-md' href='".base_url("/Welcome/editvendor/".$row->VendorId)."'>Edit</a></td>";
Upvotes: 2