yii - how to implement afterSave method to a specific controller action only? -


Assume that I have the model I..then Model A is being used by many controllers ... now I In the model of only one controller, which later uses Model A. For example, in the controller C, the function calls (), so I want to call that function later. that it is?

  Safe function after saving () {parent: :: save (); If ($ this-> hainai record) {echo "hello"; Go out; Because} Save all of all controllers using Model A. () affects save () after affecting call  
Post text "itemprop =" Text ">

after you function:

  if (Yii :: app () -> gt; controller-> id! == ' Your Controller ') {// What You Want to Do}   

If necessary, you can test the value of the Yii :: app - the controller- & Gt; Action-> ID .

Edit : or J. Sector de fries Take a look at the answer. / P>

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -