php - codeignitor's anchor() method fails to hit method name specified in controller -
i want link anchor method "newinvoice()" specified in controller
<?php $this->load->helper('url'); ?> <li><?php echo anchor('new_invoice_c/newinvoice', 'new invoice'); ?></a> </li>
controller
class new_invoice_c extends ci_controller { public function newinvoice() { $this->load->view('new_invoice'); } }
the problem anchor()
not returning full string (when check via "view page source) upto first paraemeter i.e. method name follows.
<a href="http://localhost/cibs/index.php/new_invoice_c">
when renamed mehtod index()
view loaded successfully.
it may seem naive here tried
echo anchor(site_url('new_invoice_c.php/newinvoice'), 'new invoice'); echo anchor('new_invoice_c.php/newinvoice', 'new invoice');
beside refresh page after clearing chache still unable figure out.
change
<li><?php echo anchor('new_invoice_c/newinvoice', 'new invoice'); ?></a> </li>
to
<li><?php echo anchor('new_invoice_c/newinvoice', 'new invoice'); ?></li>
you added </a>
not required
Comments
Post a Comment