Jump to content

adding members to objects dynamically?


Liquid Fire

Recommended Posts

do you think it is bad practice to create class members dynamically?  Like i have my mvc framework and i have a list of companies.  for each company on this page i want to create a mvc link and i have a url_helper class to generate one for me.  Now the best way to like this link to the company is to have it as a member however the company model class does not need this member part of it always.  is it bad practice to add the link to the company class dynamically?  is there a better way to link the link to the object if so?

 

The only other way is to have the code to generate the link inside the view file but the view file is a xtemplate file so i can't do that

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.