这可能是一个错字,但我看不到它......它让我疯狂!不能“使用”在symfony2.4中的表格
我的结构是:
软件包:/ Symfony24/src目录/ NRtworks/ChartOfAccountsBundle
我的形式:/Symfony24/src/NRtworks/ChartOfAccountsBundle/Form/Account_fastedit_form.php
该控制器像这样:
<?php
namespace NRtworks\ChartOfAccountsBundle\Controller;
//form loading
use NRtworks\ChartOfAccountsBundle\Form\Account_fastedit_form;
use NRtworks\SubscriptionBundle\Form\NewCustomer;
class ChartOfAccountsController extends Controller
{
public function indexAction()
{
new NewCustomer();
new Account_fastedit_form();
}
}
?>
表格我的表格类/ Account_fastedit_form.php
<?php
namespace NRtworks\ChartOfAccountsBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class Account_fastedit_form extends AbstractType
{
//whatever
}
?>
然后我得到:
ClassNotFoundException: Attempted to load class "Account_fastedit_form" from namespace "NRtworks\ChartOfAccountsBundle\Form" in /home/eagle1/www/Symfony24/src/NRtworks/ChartOfAccountsBundle/Controller/ChartOfAccountsController.php line 72. Do you need to "use" it from another namespace?
我不觉得我的错误。 PS:你可以看到我可以用我的形式NewCustomer,另一束没有任何问题,而且结构相似...
Symfony的可能不喜欢你混合的事实'CamelCase'和'snake_case'在你的班级命名方案中为'NRtworks \ ChartOfAccountsBundle \ Form \ Account_fastedit_form' –