• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In Dropdown href not taking method in controller

I have below code in view file - menu.php: (lines reduced for ease of checking..)
<h3>ABC Fruits</h3>
<div id="Startup">

<ul class="" id="">
            <ul><li><a href="localhost:8015/citest3/index.php/soft1/sell">sell</a></li></ul>
            <ul><li><a href="localhost:8015/citest3/index.php/soft1/buy">buy</a></li></ul>


And below Code in Controller - Soft1.php file:
defined('BASEPATH') OR exit('No direct script access allowed');

class Soft1 extends CI_Controller {

public function index()
    public function sell()
            echo "Sales Done";
    public function buy()
            echo "Purchase Done";

I get a menu as per attachment when I run the code. But when I click on menu option I expect the respective function (method) in the controller to run. (for eg: if I click on sell - the sell method in controller should run & "Sales Done" should get displayed). But it is not responding. But if I put "www.example.com" it goes there. Also, when I copy the "localhost:8015/citest3/index.php/soft1/buy" on browser it works! 

But it is not working when I click on the menu item.

What could be the problem? please suggest a solution.

Attached Files Thumbnail(s)

Messages In This Thread
In Dropdown href not taking method in controller - by Sovani Shreeniwas - 02-08-2019, 03:48 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.