public function newreg()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$this->load->model('register_model');
$data['list']=$this->register_model->add($username, $password);
$this->load->view('register_display', $data);
}
Run Code Online (Sandbox Code Playgroud)
调用此函数后,这是一个名为register.php的控制器的一部分,我在屏幕上看到的只是空格.
此功能是工作控制器的工作副本的精确副本.仅更改文件名(模型,视图)
我无法弄清楚问题出在哪里.
我试图在单击按钮时隐藏框架."注册"按钮应该打开一个框架,用户可以注册,这是有效的,但我试图隐藏前一帧,我无法弄清楚如何做到这一点.
这是我的代码:
MainPage.java
package Practice_1;
import java.awt.*;
import java.awt.Insets;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
/**
*
* @author Ivan
*/
public class MainPage extends JPanel
{
JButton regButton, logButton, listButton;
JLabel homeMessage;
GridBagConstraints gbc = new GridBagConstraints();
public MainPage()
{
setLayout(new GridBagLayout());
gbc.insets = new Insets(5,5,5,5);
homeMessage = new JLabel("Please select an option below:");
gbc.gridx = 0;
gbc.gridy = 0;
add(homeMessage, gbc);
regButton = new JButton("Register");
gbc.gridx = 0;
gbc.gridy = 1;
gbc.fill = GridBagConstraints.HORIZONTAL;
regButton.addActionListener(new ActionListener() …Run Code Online (Sandbox Code Playgroud)