Yii skeleton app
#161
Posted 01 July 2010 - 01:07 PM
#162
Posted 03 July 2010 - 07:22 AM
download http://subversion.apache.org/ fire up the cmd
paste the svn command line found in previous post.. you should be downloading the codes.
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'post.created' in 'order clause'
Change all `post`.`fieldname` to `t`.`fieldname` on Controller and Views
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'created' doesn't have a default value
http://www.yiiframew...oc/cookbook/10/
http://www.yiiframew...mestampBehavior
in Model
public function behaviors(){
return array(
'ParseCacheBehavior' => array(
'class' => 'ParseCacheBehavior',
'attributes' => array('content'),
),
/* Remove this
'AutoTimestampBehavior' => array(
'class' => 'AutoTimestampBehavior',
'class' => 'application.components.behaviors.AutoTimestampBehavior',
)
*/
//added this codes
'CTimestampBehavior' => array(
'class' => 'zii.behaviors.CTimestampBehavior',
'createAttribute' => 'created',
'updateAttribute' => 'modified',
'setUpdateOnCreate' => true,
)
);
}
When creating a new post
Missing argument 1 for Post::beforeValidate(), called in D:\Domains\altruism.com.my\wwwroot\framework\base\CModel.php on line 147 and defined
//REPLACE
protected function beforeValidate($on) {
if ($this->isNewRecord)
$this->user_id = Yii::app()->user->id;
return parent::beforeValidate($on);
}
//WITH
protected function beforeValidate() {
if ($this->isNewRecord)
$this->user_id = Yii::app()->user->id;
return parent::beforeValidate();
}
Will add more if i get it to run..
#163
Posted 03 July 2010 - 02:38 PM
I get this when I register a new user but can't find anywhere that filled up the about field.
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'about' doesn't have a default value
#164
Posted 14 July 2010 - 04:16 PM
public function safeAttributes() {
return array(
//parent::safeAttributes(),
'update'=>'about, password, password_repeat',
'updateAdmin'=>'about, password, password_repeat, group_id',
'login'=>'username, password, rememberMe',
);
}
safeAttributes() was removed in 1.1 and became part of the validation rules as detailed in the Definitive Guide here: Upgrading from 1.0 to 1.1
I added these lines to the validation rules:
array('about, password_repeat','safe', 'on' => 'update, updateAdmin'),array('username, rememberMe','safe', 'on' => 'login'),Some of the other fields were already covered by other rules which should make them 'safe' under those scenarios. That is, if I am understanding correctly.
Anyway, user registration now works on the Skeleton app under 1.1.3. I am digging around in it and I'll see what else comes up.
#165
Posted 14 July 2010 - 04:29 PM
public function safeAttributes() {
/**
* ActiveRecord is extended to know that 'required' attributes are 'safe'.
* We return a empty array so that it won't think 'created' and 'modified' are 'safe'.
* It will still know 'title' and 'content' are safe because they are 'required'
*/
return array();
}
You may want to remove that as well.
#166
Posted 27 February 2011 - 10:54 AM
I've uploaded the Yii skeleton app with my modifications to make it work with yii-1.1.6.r2877
you can download it here : websitebuildingsolutions.com/Yii_skeleton.rar
In the tables creation file - the user table creation should be :
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` char(50) NOT NULL, `email` varchar(100) NOT NULL, `email_visible` tinyint(1) NOT NULL DEFAULT '0', `notify_comments` tinyint(1) NOT NULL DEFAULT '1', `notify_messages` tinyint(1) NOT NULL DEFAULT '1', `about` text DEFAULT NULL, `aboutParsed` text NOT NULL, `group_id` int(11) NOT NULL DEFAULT '2', `email_confirmed` char(21) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
the change from the original file - `about` text DEFAULT NULL,
The only error I get now (from what I sew) is in jquery:
elem.attributes is null
but it looks like everything works...
Hope it will help
#167
Posted 27 February 2011 - 12:42 PM
shani1351, on 27 February 2011 - 10:54 AM, said:
I've uploaded the Yii skeleton app with my modifications to make it work with yii-1.1.6.r2877
you can download it here : websitebuildingsolutions.com/Yii_skeleton.rar
In the tables creation file - the user table creation should be :
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` char(50) NOT NULL, `email` varchar(100) NOT NULL, `email_visible` tinyint(1) NOT NULL DEFAULT '0', `notify_comments` tinyint(1) NOT NULL DEFAULT '1', `notify_messages` tinyint(1) NOT NULL DEFAULT '1', `about` text DEFAULT NULL, `aboutParsed` text NOT NULL, `group_id` int(11) NOT NULL DEFAULT '2', `email_confirmed` char(21) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
the change from the original file - `about` text DEFAULT NULL,
The only error I get now (from what I sew) is in jquery:
elem.attributes is null
but it looks like everything works...
Hope it will help
#168
Posted 28 February 2011 - 07:53 AM
And much thanks to the guy who put it together in the first place. In learning Yii the first thing I was thinking after making a few test projects was making a new skeleton of my own until I stumpled onto yours. I was working on getting it up and running for the latest version of yii as well, you saved me a bunch o time no doubt.
I found one other error that I fixed as well that I wanted to pass on. If you go to posts section while you are not logged in and try to create a post, you get a "Property "AccessRule.message" is not defined.", meaning basically it can't find the variable that is supposed to be holding the "not logged in" or whatever.
The fix is to take this file:
/protected/components/AccessControlFilter.php
in the AccessRule class at or around line 75, or anywhere where the class properties are defined, add this:
/** * @var string the error message to be displayed when authorization is denied by this rule. * If not set, a default error message will be displayed. * @since 1.1.1 */ public $message;
seems to fix that issue.
Christopher
#169
Posted 28 February 2011 - 11:17 PM
#170
Posted 12 March 2011 - 11:19 PM
I've spent the last few months trying to learn a PHP framework. I've always rolled my own. First CodeIgniter, then Kohana and now Yii. I've gotten more accomplished in the last six hours with Yii than I have with CI and KO3 since November 2010.
It seems rudimentary to me that a framework would offer a working skeleton to give the developer a quick start. After all, isn't that is what a framework is for - quick development? And that (speaking for myself) is lacking with the other frameworks I've tried. Thanks for helping me get started.
#171
Posted 13 March 2011 - 08:23 PM
Quote
elem.attributes is null
In file /protected/modules/textedit/components/TextEditor.php, around lines 64,65 change...
loaddata: {id: $(this).attr('id')},
submitdata: {id: $(this).attr('id')},
to...
loaddata: {id: this.id},
submitdata: {id: this.id},
I'm not sure this is the proper way to do it but it worked for me.
#173
Posted 03 August 2011 - 08:18 PM
#174
Posted 03 August 2011 - 08:35 PM
insun, on 03 August 2011 - 08:18 PM, said:
Checkout:
Quote
using one of these: http://en.wikipedia....mparison_matrix
#175
Posted 20 September 2011 - 01:52 PM
dhanya_kr, on 20 September 2009 - 08:52 AM, said:
I got the app. but when i try the links i am getting the following error.
'Not Found The requested URL /yii/site/contact was not found on this server.'
Can anyone help me to solve this?
Edit the /config/main.php
Update or coment the param urlManager

Help
This topic is locked













