• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
js code in controller

#1
[eluser]spherop[/eluser]
is there anything i should be wary of in including blocks at the bottom of my controllers for js controller logic?

#2
[eluser]gtech[/eluser]
I assume you are echoing javascript in the controllers?

I tend to write my js in views, however sometimes I cheat and just echo json return data in the controller.

The only thing you should be wary of is maintainability. if you have a large applications with every controller containing blocks of javascript it may become unreadable.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.