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
https://forums.phpfreaks.com/topic/94047-adding-members-to-objects-dynamically/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.