I’m new with PHP and Yii and I was trying to rub Model and CRUD generator from Yii demo application. In both cases I get this:
CDbConnection.connectionString cannot be empty.
35 public function requiredTemplates()
37 return array(
42 public function init()
45 throw new CHttpException(500,'An active "db" connection is required to run this generator.');
49 public function successMessage()
51 $link=CHtml::link('try it now', Yii::app()->createUrl($this->controller), array('target'=>'_blank'));
52 return "The controller has been generated successfully. You may $link.";
55 public function validateModel($attribute,$params)
THis demo came with latest stable version. I have check content of connectionString and it matches the real data, like port, database name. Database is started and accessible with phpadmin. What could be wrong?
Does it work if you comment out the db part for mysql, and uncomment the part for sqlite? Trying to work out if it’s an error with your config file, as this error should only appear when no connectionString has been specified.