i have foms folder, inside forms folder i have SendNewsLetter.php that contains the ff. code
<?php
use Phalcon\Forms\Form,
Phalcon\Forms\Element\Submit,
Phalcon\Validation\Validator\PresenceOf,
Phalcon\Validation\Validator\Email,
Phalcon\Validation\Validator\Identical,
Phalcon\Validation\Validator\StringLength;
class SendNewsLetter extends Form(){
public function initialize(){
$this->add('email', new PresenceOf(array(
'message' => 'The e-mail is required'
)));
$this->add('email', new Email(array(
'message' => 'The e-mail is not valid'
)));
$this->add(submitButton(array("Subscribe Now", "class" => "btn btn-success")));
echo"hahaha";
}
}
in my loaders i have this code
$loader->registerDirs(
array(
$config->application->controllersDir,
$config->application->modelsDir,
$config->application->formDir
)
)->register();
in my view
{{ SendNewsLetter() }}
but it shows this error
Notice: Undefined offset: formDir in C:\Users\spilagan20140973\Desktop\BOOTSTRAP FILES\PORTABLES\USBWebserver v8.6\root\PHALCON\app\config\loader.php on line 12
Undefined function 'SendNewsLetter' in C:\Users\spilagan20140973\Desktop\BOOTSTRAP FILES\PORTABLES\USBWebserver v8.6\root\PHALCON\app\config/../../app/views/index/index.volt on line 203
You can take a look on my code, tnaks in advance.