简体   繁体   English

include(password.php)[ <a href='function.include'>function.include</a> ]:无法打开流:没有这样的文件或目录

[英]include(password.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

i am a newbie in yii framework its been just 4 days i am stuck in this problem can someone help me below is my code.. 我是yii框架中的新手,仅用了4天的时间我就陷入了这个问题,下面有人可以帮助我吗?

this is view ... 这是视图...

<div class="form">
<?php echo CHtml::beginForm(); ?>

<?php echo CHtml::errorSummary($model); ?>

<div class="row">
    <?php echo CHtml::activeLabel($model,'email'); ?>
    <?php echo CHtml::activeEmailField($model , 'email') ?>

</div>  

<div class="row">
<?php  echo CHtml::activeLabel($model, 'password'); ?>
<?php  echo  CHtml::activePasswordField($model, 'password');  ?>

</div>
 <?php echo CHtml::endForm(); ?>    

my simple code for model 我的模型简单代码

<?php
class C_regsiter extends CFormModel{

public $username;
public $Password;
public $email;
public $data; 
protected  $id;

public function rules(){

return array(

array('username','password','email','required'),
array('email','email'),      

);

 }

public function attributelabel(){


 return array(

 'username'=>'User Name',
 'Password'=>'Password',
 'email'=>'Email Address '

); 

}

}

this is my controller 这是我的控制器

class RegisterController extends Controller
{
 public function actionIndex()
 {
  $model=new C_regsiter();
  $this->render('index',array('model'=>$model));

 }

the problem is whenever is call the activepasswordfield is got an error please help 问题是每当调用activepasswordfield时出现错误,请帮助

This is about Yii 1 right? 这是关于Yii 1对吗? Check your models rules definition. 检查模型规则定义。 The "required" notation is wrong. “必需”表示法是错误的。 It should be array('username, password, email', 'required'), 它应该是array('username, password, email', 'required'),

First element should be the attributes, second the validator. 第一个元素应该是属性,第二个是验证器。 array('attribute list', 'validator name', 'on'=>'scenario name', ...validation parameters...)

See the documentation . 请参阅文档

What your code tried to do: It takes the second element as a validator class, which it tries to include, but you don't have such a file, hence the include error. 您的代码尝试执行的操作:它将第二个元素用作尝试包含的验证器类,但是您没有这样的文件,因此包含错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP警告[function.include]:无法打开流 - PHP Warning [function.include]: failed to open stream 警告:include(../config/config.php) [function.include]:无法在 PHP 中打开流 - Warning: include(../config/config.php) [function.include]: failed to open stream in PHP 错误500-include(user_id.php)[function.include]:无法打开流(尽管代码在本地工作)(Yii 1.x) - Error 500 - include(user_id.php) [function.include]: failed to open stream (although code works locally) (Yii 1.x) 警告:include()[function.include]:文件名不能为空PHP - Warning: include() [function.include]: Filename cannot be empty PHP include()提供[function.include]:尝试加载另一页时无法打开错误 - include() gives [function.include]: failed to open error while trying to load another page 使用直接链接时出现function.include错误 - function.include error when using a direct link include_once(): 无法打开流:没有这样的文件或目录 - PHP - include_once(): failed to open stream: No such file or directory - PHP Yii - 包含(PDO.php):无法打开流:没有这样的文件或目录 - Yii - include(PDO.php): failed to open stream: No such file or directory 警告:包括(dbconn.php):无法打开流:没有这样的文件或目录 - Warning: include(dbconn.php): failed to open stream: No such file or directory 断断续续-PHP警告:包括无法打开流:没有此类文件或目录 - intermittent - PHP Warning: include failed to open stream: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM