Yii Framework Forum: Smarty view renderer - Yii Framework Forum

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Smarty view renderer Allows you to use Smarty templates in Yii Rate Topic: -----

#41 User is offline   andybegin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 18-April 13

Posted 30 August 2013 - 10:57 AM

View Posthadi, on 30 July 2012 - 09:32 AM, said:

How I can use beginWidget CActiveForm?

I try this:
{$this->beginWidget('CActiveForm', [
        'id'=>'contact-form',
        'enableClientValidation'=>true,
        'clientOptions'=>[
                'validateOnSubmit'=>true
        ]
],true)}


but result display error like that:
Object of class CActiveForm could not be converted to string 


Thanks.




That's right. When i am ready to use smarty to be the template engine for YII,but i find there is so much problem like use Grid and any others . Anyone have a good ways to resolved this ?
0

#42 User is offline   garancsi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-February 13
  • Location:Budapest, Hungary

Posted 07 December 2013 - 12:42 PM

I also struggled with beginWidget in smarty template until I found a working solution on a russian site.
You have to use the smarty assign function:

{assign var=form value=$this->beginWidget('CActiveForm', [
        'id'=>'login-form',
        'enableClientValidation'=>true,
        'clientOptions'=>[
            'validateOnSubmit'=>true
        ]
    ], true)}


also You should call endWidget the same way:

{assign var=form value=$this->endWidget()}

0

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • 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