carlosx2 Posted January 12, 2011 Share Posted January 12, 2011 Ok so i am really stuck here. I am trying to determen how the variable $this is being set and where. I am modifying the com_content of joomla. Only the carticle and i would like to connect the article with K2 component. But to do this i need to load information from the joomla data base. so far i have gotten this far. I am adding this below the article text. I am getting the name of the article and set into a variable. I have no idea where $this is being loaded with the jos_article stuff but it does that. I need to find that page to understand how it is working. So i have gotten this far. <?php echo $this->article->text; $tests = $this->article->title; print_r ($tests); ?> Now i want to connect to the k2 table within the joomla database to search is the name of the article is also represented in the k2 table. If so it will out put a link to the k2 table if there is non it will out put nothing. My question is how do i connect to the k2 table when the $this variable is loaded with all the info from article content. I need to know how i can load a second variable that loads all the K2 table content. I have noticed that also in the K2 component $this is being set to get all the info. How hard is it to find this variable in the script pages. lol I hope i made it clear what i am looking for. thanks Quote Link to comment Share on other sites More sharing options...
trq Posted January 12, 2011 Share Posted January 12, 2011 I've not used Joomla, but I'm sure it uses an MVC architecture. $this likely refers to the View object. Generally what happens is templates are pulled into the View object before they are rendered, thus making $this refer to the object itself (the View). Now, what that View object is called and what file it's in I don't know, but that is where I would start. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.