我有一个带有index()
和newFunction()
的控制器。当我的索引函数加载时,它会加载我需要的第一个视图。我在该视图上有一个提交按钮:
<div class="btn"><input type="submit" name="submit" id="submit_button" value="Pay"></input></div>
我希望该提交按钮加载newFunction()
,作为新页面,现在它正在索引视图下加载newFunction()
/视图。
这是我在索引函数中调用的方法,尝试将新视图加载为新页面。除了它在它下面加载它。
$submit = $this->input->post("submit");
if($submit == "Pay") {
$this->pay($postData);//pay is the name of newFunction();
}
答案 0 :(得分:0)
public function index()
{
if($this->input->post("submit") == "Pay")
{
$this->pay($postData);//pay is the name of newFunction();
return; // With this, rest of the code wont execute.
}
}