php - Yii Recoverable error "Object of class **** could not be converted to string" -
I have two models in my web application "Manufacturer Offer" and "Vegetable". I need to create an Object of "Producer Offer" model inside the "Vegetable" model. But I am getting this error and I am unable to locate the source. . I wrote code for my idea named "view.php". My relation function in product-based model & gt; array (auto :: BELONGS_TO, 'vegetation', 'id'),);} I'm unable to detect the source of the error?What should be done by the browser? An error is occurring in this line as shown by the browser In the Administrator I am getting the error in these lines. error may be on this line: The second argument for this method is Or like it: (Try it yourself, I do not remember it is possible to give the array of models as the first argument)
public function actioncure offender ($ ID) {$ model = $ this-> LoadModel ( $ Id); $ manufactureroffer = new developer; if (isset ($ _ POST ['product' ']) and (isset ($ _ POST [ 'Vegetable'])) $ $ Manufacturer-> Factor = $ _ POST ['Manufacturer' ']; $ Model & gt; Properties = $ _ Post [' Vegetable ']; $ ProducerOffer- & gt; vegetable_id = $ Model & Gt; ID; if ($ model-> Validate) and $ manufacturer offer-> Validate ()) {$ model-> Save (); $ ProducerOffer- & gt; Save; } If (($ model-> apers () === false) & amp; amp; ($ manufacturer offers-> hayers () === incorrect)) {$ this-> Redirect ( Yii :: app) -> user-> returnUrl);}} and {Yii :: app () -> user- & gt; cetrerenault ($ _GET ['returnUrl']); } $ This- & gt; Render ('offer', array ('produceroffer' = & gt; $ manufacturer offer, 'model' => gt; $ model)); }
& lt; Div style = 'padding-left: 50px' & gt; & Lt ;? Php $ form = $ this- & gt; Start the widgets ('bootstrap.widgets.TbActiveForm', array ('id' = & gt; 'non-Ajax_form', 'enabledAjax validity' = & gt; wrong,)); ? & Gt; & Lt; p class = "help-block" & gt; With Field & lt; span class = "required" & gt; * & Lt; / Span & gt; Are necessary. & Lt; / P & gt; & Lt ;? Php echo $ form-> Errorsider ($ models, $ manufacturer offer); ? & Gt; & Lt; B & gt; & Lt ;? php echo chtml :: encoded ($ model-> getAttributeLabel ('name')); ? & Gt; & Lt; / P & gt; & Lt ;? Php echo CHtml :: textField ("vegetation [name]", $ model-> name); ? & Gt; & Lt; B & gt; & Lt ;? Php Echo CHtml :: Encoded ($ manufacturer offer- & gt; getAttributeLabel ('offer_key')); ? & Gt; & Lt; / P & gt; & Lt ;? Php echo CHtml :: textField ("Manufacturer Offer [Offer_Kitty]", $ buildoffer-> offer_kitty); ? & Gt; & Lt ;? Php echo CHtml :: encoded ($ builder-> getAttributeLabel ('unit_cost')); ? & Gt; & Lt ;? Php echo CHtml :: textField ("Manufacturer offers [Unique_cast]", $ buildoffer-> UniCast); ? & Gt; & Lt ;? php echo CHtml :: encoded ($ builder-> getAttributeLabel ('unit_delivery_cost')); ? & Gt; & Lt ;? Php echo CHtml :: textField ("Manufacturer offer [Unit _ Delivery_Cast]", $ manufactureroffer-> UNIK_ DELIVERY_CAST); ? & Gt; & Lt; Div class = "form-action" & gt; & Lt ;? Php $ this- & gt; Widget ('bootstrap.widgets.TbButton', array ('button type' = 'gtx;' submit ',' type '= & gt;' primary ',' label '= & gt;' save ',)); ? & Gt; & Lt ;? Php $ this- & gt; Widget ('bootstrap.widgets.TbButton', array ('button type' = 'gtc: reset', 'type' = & gt; 'primary', 'label' = & gt; 'reset')); ? & Gt; & Lt ;? Php $ this- & gt; Widget ('bootstrap.widgets.TbButton', array ('button type' = & gt; 'link', 'type' = & gt; 'primary', 'label' = & gt; 'cancel', 'url' = & Gt; Yii :: application () -> User-> returnUrl,); ? & Gt; & Lt; / Div & gt; & Lt ;? Php $ this- & gt; Endvijet (); ? & Gt; & Lt; / Div & gt;
public function relations () {return array ('manufacturer offer merged' => array (auto :: BELONGS_TO, my connection function in vegetable model
public function relationship () {return form ('manufacturer offer relation' = 'vegetable', 'vegetable_ID' '}}}}
$ this-> render ('offer', array ('Manufacturer offer' = $ manufacturer offer, 'Model' = & gt; $ Models));
Errorsider ($ models, $ manufacturer offer); ? & Gt;
string $ header but you are going through the $ manufacturer $ $ to change it like this:
< Code> & lt ;? Php echo $ form-> Errors (Array ($ Model, $ Manufacturer Offer)); ? & Gt;
ErrorModer ($ Models); ? & Gt; & Lt ;? Php Acor $ form- & gt; ErrorCurrent ($ manufactureroffer); ? & Gt;
Comments
Post a Comment