dtv8189 2014-08-05 09:49
浏览 36

找不到ZF2-接口'.. \ Model \ InputFilterAwareInterface'

My zend framework 2 project concerns an online restaurant Menu and something is wrong with my code because I am having this error:

Fatal error: Interface 'Pizza\Model\InputFilterAwarelnterface' not found
C:\wamp\www\pizza\module\Pizza\src\Pizza\Model\pizza.php on line 9

Please help me to find what's wrong with my code. Here is pizza.php file:

<?php 

namespace Pizza\Model;
use Zend\InputFilter\InputFilter; 
use Zend\InputFilter\InputFilterInterface; 
use Zend\InputFilter\InputFilterAwareInterface;

class Pizza implements InputFilterAwarelnterface 
{ 
    public $id; 
    public $name;
    public $ingredients; 
    public $smallprice; 
    public $bigprice; 
    public $familyprice; 
    public $partyprice;
    protected $inputFilter;



 public function __construct()
 {
 } 

 public function exchangeArray($data) 
 { 
    $this->id            = (!empty($data['id']))          ? $data['id']           :null;
    $this->name          = (!empty($data['name']))        ? $data['name']         :null;
    $this->ingredients   = (!empty($data['ingredients'])) ? $data['ingredients']  :null;
    $this->smallprice    = (!empty($data['smallprice']))  ? $data['smallprice']   :null;
    $this->bigprice      = (!empty($data['bigprice']))    ? $data['bigprice']     :null;
    $this->familyprice   = (!empty($data['familyprice'])) ? $data['familyprice']  :null;
    $this->partyprice    = (!empty($data['partyprice']))  ? $data['partyprice']   :null;
} 

public function getArrayCopy() 
{ 
    return get_object_vars($this); 
} 


public function setInputFilter(InputFilterInterface $inputfilter)
{ 
    throw new \Exception("not used"); 
}


public function getInpunFilter() 
{ 
    if(!$this->inputFliter)
    { 
        $inputfilter = new InputFilter(); 
        $inputfilter->add(array('name' => 'name',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 5,
                                                                         'max'      =>30,),
                                                      ))
                                )
                          );

        $inputfilter->add(array('name' => 'ingredients',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 5,
                                                                         'max'      =>255,),
                                                      ))
                                )
                          );

        $inputfilter->add(array('name' => 'smallprice',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 1,
                                                                         'max'      => 5,),
                                                      ),
                                                      array(
                                                            'name'    => 'float',
                                                            'options' => array(
                                                                               'locale' => 'en_us')
                                                            )
                                                      )
                                )
                          );

        $inputfilter->add(array('name' => 'bigprice',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 1,
                                                                         'max'      => 5,),
                                                      ),
                                                      array(
                                                            'name'    => 'float',
                                                            'options' => array(
                                                                               'locale' => 'en_us')
                                                            )
                                                      )
                                )
                          );


        $inputfilter->add(array('name' => 'familyprice',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 1,
                                                                         'max'      => 5,),
                                                      ),
                                                      array(
                                                            'name'    => 'float',
                                                            'options' => array(
                                                                               'locale' => 'en_us')
                                                            )
                                                      )
                                )
                          );


        $inputfilter->add(array('name' => 'partyprice',
                                'required' => true,
                                'filters' => array('name' => 'StringTrim'),
                                             array('name' => 'StringTags'),
                                'validators' => array(
                                                      array(
                                                      'name'    => 'StringLength',
                                                      'options' => array(
                                                                         'encoding' => 'UTF-8',
                                                                         'min'      => 1,
                                                                         'max'      => 5,),
                                                      ),
                                                      array(
                                                            'name'    => 'float',
                                                            'options' => array(
                                                                               'locale' => 'en_us')
                                                            )
                                                      )
                                )
                          );

        return $this->inputFilter;


    }


    return $this->inputFilter; 
} 



}
  • 写回答

1条回答 默认 最新

  • doujiaoben28596 2014-08-05 09:59
    关注

    Simple typo:

    class Pizza implements InputFilterAwarelnterface 
                                           ^
                                           This character should be an 'I', not a 'l'
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用