Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Class Not Found Fatal Error

$
0
0
Hi,

I'm a complete beginner with Yii, so apologies up front for any ignorance on the matter.

I followed the tutorial for the first Yii app and then decided to add a second model to the testdrive app. This all went well, however one of the properties of the new model refers to a column with an ENUM datatype for which I wanted to generate a dropdown list as opposed to the default text field.

I found this post and implemented class ZHtml in ZHtml.php as described in the post. I put ZHtml.php in testdrive/protected/components.

Next I modified my _form.php file for my newly created model with the enumDropDownList, as suggested in the post:

<div class="row">
  <?php echo $form->labelEx($model,'calculateDeposit'); ?>
  <?php echo ZHtml::enumDropDownList($model, 'calculateDeposit'); ?>
  <?php echo $form->error($model,'calculateDeposit'); ?>
</div>


When I run the app, I see a stack trace in the logs complaining that ZHtml was not found:

PHP Fatal error:  Class 'ZHtml' not found in /Applications/MAMP/htdocs/testdrive/protected/views/property/_form.php on line 50


From my config file I see the following, suggesting that my new file should be available as autoload:

// autoloading model and component classes
'import'=>array(
  'application.models.*',
  'application.components.*',
),


I'm obviously missing something. Any help is appreciated...

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>