Hey, ben bir php uygulama kodlama yapıyorum ve bana kodlama ve uyku eksikliği gerçekten kötü olması (göremiyorum nedense ben bir hata, içine koşuyoruz onunla ilgisi olabilir.
Her neyse, burada benim zor sorun :)
Parse error: syntax error, unexpected $end, expecting T_FUNCTION
and the code:
The model
class Model_DbTable_Users extends Zend_Db_Table_Abstract
{
protected $_name = 'users';
public function addUser($username, $password, $email)
{
$data = array( 'username' => $username,
'password' => $password,
'email' => $email);
$this->insert($data);
}
ve eylem
public function stage1Action()
{
$form = new Form_RegisterForm;
$this->view->form = $form;
$request = $this->getRequest();
#if the form is submitted
if($request->isPost()){
#validated automatically by the form-errors echoed if invalid
if($form->isValid($this->_request->getPost())) {
$username = $form->getValue('username');
$password = $form->getValue('password');
$email = $form->getValue('email');
$users = new Model_DbTable_Users;
$users->addUser($username, $password, $email);
$this->_helper->redirector('stage2');
}
}
}
Ben submit düğmesine bastıktan sonra bu eylemi olsun.
Herhangi bir yardım büyük takdir. Şimdiden teşekkürler