Yii Framework Forum: Enhanced Blog by mocapapa on Version 1.1 Question - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Enhanced Blog by mocapapa on Version 1.1 Question Rate Topic: -----

#1 User is offline   bgdog 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 28-February 10

Posted 08 April 2010 - 02:21 PM

I am a newbie and still finding my way around. I am studying the mocapapa enhanced blog. I have many features working on version 1.1.1 but can't seem to get highslide working properly. It seems to come down to turning MarkdownParserHighslide.php on in the post model (from the Yii Cookbook):

Replace CMarkdownParser to MarkdownParserHighslide in the two files of blog/protected/models/Comment.php and blog/protected/models/Post.php as follows.

protected function beforeValidate($on)
{
- $parser=new CMarkdownParser;
+ $parser=new MarkdownParserHighslide;


I know beforeValidate has been changed in 1.1.1 What should I be using. I have tinkered with onBeforeValidate but I think my syntax is off. Can anyone supply the correct function and syntax for Version 1.1.1? Thanks.
--
bgdog
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 08 April 2010 - 03:32 PM

The 1.0.12 API Reference has this note about the $scenario parameter:

Quote

As of version 1.0.4, this parameter is deprecated, and the scenario property is the preferred way of specifying the scenario

http://www.yiiframew...validate-detail

See also 1.1.1 API Reference on beforeValidate()
http://www.yiiframew...#beforeValidate

(not tested)
/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users