Yii Framework Forum: Code Clips / Snipets - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Code Clips / Snipets Reutilization of recurrent code Rate Topic: -----

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 05 July 2010 - 05:55 PM

Good night everyone!

On my application I have a lot of recurrent code. Where can I put then together to reuse when I need?

Create a new component and call this when I need?

Create a lot of widgets?

Create a lot of extensions?

Create widgets clips?
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 06 July 2010 - 01:54 AM

It depends on what your code is.

If is a part of page (with html) you can try to generalize the code and wirte a widget. Like, for example, CLinkPager.

If is only php code that do some task you can try to generalize this task and create a component (like, for example, CPagination).

If your code are several page that are always the same in many projects, you can do a module (like user module).
0

#3 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 06 July 2010 - 07:30 AM

Tanks dude. I was thinking about this ether.

:)
0

Share this topic:


Page 1 of 1
  • 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