2016-09-28 134 views

回答

0

welcome.php控制器是您的默認設置,並且當您未在控制器中聲明函數名稱時,它會加載index()函數,因此加載http://localhost/antimalarial/將在索引函數中加載歡迎控制器。

但是,如果您要在welcome控制器中加載任何其他功能,則需要提供控制器名稱函數名稱。

你的鏈接應該是http://localhost/antimalarial/welcome/fivespecies

+0

我應該提供控制器名稱 –

+0

作爲菜單項的鏈接。你鏈接到:http:// localhost/antimalarial/fivespecies當它應該是http:// localhost/antimalarial/welcome/fivespecies –

+0

Iam sorrry iam有點慢編程請告訴我上述鏈接的程序 –

0

你可能需要寫你的網址爲:http://localhost/antimalarial/Welcome/fivespecies

如果此鏈接不起作用,試試這個: http://localhost/antimalarial/index.php/Welcome/fivespecies 此情況下是有效的,如果你還沒有設置.htaccess文件。

如果你想從你的url中刪除index.php。請下載並在根目錄中添加.htaccess文件。 Click here下載文件。

希望這會有所幫助。

+0

如何刪除index.php –

+0

我在答案中添加了.htaccess文件鏈接。下載該文件並將其粘貼到根目錄中。 – Paras

+0

你會發現你的項目名稱爲「antimalarial」.htaccess文件。每當您設計一個新項目時,只需在.htaccess文件中更改名稱即可。 – Paras