English 中文(简体)
例外 没有为“标题”规定任何形式要素,也没有自动从“扩散表格”中确定。
原标题:Exception No form element was specified for "title" and one not be determined automatically from "SpiffyendForm"

In addtion to my previous question Attache zend filters and validation chains to models/doctrine entities I have given a try to Spiffy framework, but I got stack with this exception like this: Exception No form element was specified for "title" and one not be determined automatically from "SpiffyendForm". In my entity I have this:

<?php

namespace Entities;
use DoctrineORMMapping as ORM;
use SpiffyDoctrineAbstractEntity as Entity;
use SpiffyDoctrineAnnotationsFilters as Filter;
use SpiffyDoctrineAnnotationsValidators as Assert;

/** @ORMEntity(repositoryClass="RepositoriesPostRepository") */
class Post extends Entity {

public function __construct()     
{
    $this->created  = new DateTime("now");
    $this->comments = new DoctrineCommonCollectionsArrayCollection();
}


public function __get($property)
{
    return $this->$property;
}

public function __set($name, $value)
{
    $this->$name = $value;

    return $this->$name;
}

/**
 * @ORMId @ORMColumn(type="integer") @ORMGeneratedValue
 */
private $id;

/**
 * @var string $title
 * @FilterAlnum
 * @AssertStringLength(5)
 * @ORMColumn(type="string",length=255) 
 */
private $title;

/**
 * @ORMColumn(type="text")
 */
private $body;

/**
 * @ORMColumn(type="datetime")
 */
private $created;

/**
 * @ORMOneToMany(targetEntity="Comment", mappedBy="post", fetch="LAZY")
 */
private $comments;
}

我的表象是这样:

   <?php
   use SpiffyendForm as Form;
   class Application_Form_Post extends Form
   {

     public function init()
    {

      //var_dump($this->getEntity()); //returns null
      // die;
      $this->add( title );

      $this->add( body );

     $this->addElement( submit ,  submit , array(

    ));

  }
 }

因此,我在这里被困。 感谢您的帮助。

问题回答

我的申请。 顺便提一下:

 pluginPaths.BisnaApplicationResource = "Bisna/Application/Resource"

以及

autoloaderNamespaces[] = Bisna

但是,我仍然例外:

  Uncaught exception  ReflectionException  with message  Class DoctrineORMMappingDriverAnnotationDriver does not exist  in C:SpiffylibSpiffyDoctrineContainer.php on line 359

我不清楚的是,在之二纳资源中,我有这样的东西:

  end_Registry::set( doctrine , $container);

以及in the spiffy resource I had like this:

 `Zend_Registry::set( Spiffy_Doctrine , $container);`

但是,在我的诱杀装置.php中,我有两个:

    $this->bootstrap( doctrine );
    $container = $this->getResource( doctrine );

I was expected to be a diffrence between doctrine 以及Spiffy_Doctrine, but is not. And something else that is for me, not understandable. I modify some line in Spiffy container like this:

try{
$reflClass = new ReflectionClass($driverClass);
}catch (LogicException $Exception) {
die( Not gonna make it in here... );
}
catch(ReflectionException $Exception)
{
die( Your class does not exist!   );
}

但是,我不是说例外,而是说:

`Uncaught exception  ReflectionException `

Ps: Sorry forplica of content from the theory group from linekdin, but these are my response. 现在,我对我的申请表示怀疑,也许我会说我所失踪的人,但任何帮助都将是巨大的。 谢谢。





相关问题
Bind Button.IsEnabled to custom validation with XAML?

I am sorry I didn t know how to title my question any better, you name it if you got a good 1. I have an entity Contact. this person has navigation properties: Address, Phones (A collection of Phone)....

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...

Rails 101 | validates_currency?

I ve searched high and low, but I could not find a solution, to what I think seems like a very common task. In a form I want to have a text input that accepts currency strings (i.e. $1,000,000 or ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签