Enhanced Blog by mocapapa on Version 1.1 Question

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

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

http://www.yiiframework.com/doc/api/1.0.12/CModel#validate-detail

See also 1.1.1 API Reference on beforeValidate()

http://www.yiiframework.com/doc/api/CModel#beforeValidate

(not tested)

/Tommy