PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 9, 2022

[FIXED] Yii 1.0: how to know whether the renderPartial is success of fail?

 January 09, 2022     php, yii     No comments   

Issue

In Yii 1.0 framework, how to know whether the renderPartial is success of fail? Assume that $information holds an associative array which only running the content in 'detail/submitForm'. See sample below:

$this->renderPartial('detail/submitForm', array('information' => $information));

Solution

i guess you could wrap it in try/catch block and use a flag variable, like so:

// flag variable to hold renderPartial's status, set to true initially
$renderSuccess = true;
try {
    $this->renderPartial('detail/submitForm', array('information' => $information));
}
catch (Exception $ex) {
    $renderSuccess = false;
}


Answered By - Sudhir Bastakoti
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing