Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Register namespace forms not working

Hi Everyone !

i have project short url, i want learn phalcon with it. i have installed phalcon with xampp . that's working ok. but upload to srv. my srv have installed nginx + apache + php + mariadb. ( reverse proxy ) only forms not load to controller then show views !

This my config namespaces in public/index.php

$loader = new Loader();

$loader->registerDirs( [ APP_PATH . '/controllers/', APP_PATH . '/models/' ] ); $loader->registerFiles( [ '../app/helper/createbitly.php', ] ); $loader->registerNamespaces( [ 'App\Forms' => '../app/forms' ] )->register();

This my header config Forms App/forms

<?php namespace App\Forms;

use Phalcon\Forms\Form; use Phalcon\Forms\Element\Text; use Phalcon\Validation; use Phalcon\Validation\Validator\Url as UrlValidator; use Phalcon\Forms\Element\Submit; // Validation use Phalcon\Validation\Validator\PresenceOf; use Phalcon\Validation\Validator\StringLength; use Phalcon\Validation\Validator\Confirmation; use Phalcon\Validation\Validator\Email;

class InputForm extends Form { public function initialize() { /**

  • Name */ $name = new Text('name', [ "class" => "form-control", "required" => true, "placeholder" => "Nhập chính xác name" ]);

This my header controlller use form : App\Controllers\LoginController

<?php // use form use Phalcon\Events\Event; use Phalcon\Events\Manager as EventsManager; use Phalcon\Http\Request; use Phalcon\Mvc\Controller; use App\Forms\loginform;

class LoginController extends Controller { public function indexAction() { $this->view->form = new loginform();

pls help me !

many thanks.

are you on windows and your server is linux? check upper/lowercase of files and classes names


Hi !

My wrong is public/index.php have dispatcher. that's not show error with model.

i have created model againt with phalcon-devtool.

it worked


i have new problem with build phalcon docker on windows. pls tell me your solution.

i can't find guide.

What error is showing?

thanks !

i fixed.