By David Montoya on Tuesday, 30 June 2015
Posted in General
Replies 6
Likes 0
Views 714
Votes 0
The more I look at Joomla development documentation, API references, and source code, the more daunting it becomes to understand how to code for Joomla. How did you guys get into coding for Joomla? How long did it take before you were confident in making extensions? The current API documentation is not beginner-friendly, and my head is spinning trying to figure out a solid starting point. I'd like to eventually code apps for ES.
I took about 6 months to really get the hang of it However, it really isn't that difficult at all once you get the hang of it.
·
Wednesday, 01 July 2015 22:20
·
0 Likes
·
0 Votes
·
0 Comments
·
I've been digging around in the source and slowly some things are starting to make sense. Namespaces as they're used in Joomla and PHP boggle me a bit though. As everything is relative to index.php I don't understand, for example, why I wouldn't use jimport(joomla.plugin.plugin) instead of "get joomla registry\registry" when the Jimport function already has that "get" namespace.
·
Wednesday, 01 July 2015 23:17
·
0 Likes
·
0 Votes
·
0 Comments
·
It's probably more of a convention rather than anything at all. For instance, in the event that Joomla decides to relocate the folders for whatever reason, your script wouldn't break since jimport is a proxy to everything

However, we often rely on require and include rather than jimport.
·
Wednesday, 01 July 2015 23:27
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm starting to wonder if I should just ignore the API functions until I actually NEED them. Following tutorials makes it a bit difficult, though, as they reference namespaces without giving the 'why' of it all.
·
Thursday, 02 July 2015 00:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Just a little something if anyone else is learning to code for Joomla: check out NoNumber's Sourcerer. I'm using a dummy article as my testbed for code. It makes it really easy to try out code within Joomla and debug. It's really good for trying out functions within Joomla that you're not familiar with. Swap out variables, echo the result of something to see how it works. Here's something I was playing with earlier:

<h2>
{source}
<?php
$article_id = JFactory::getApplication()->input->getInt('id');
$article_title = JTable::getInstance('content');
$article_title->load($article_id);
echo 'This is the current article\'s title: '.$article_title->get('title');
?>
{/source}
</h2>


VERY basic, but I imagine using this within a module while testing out various pages and running sample code to see what works and what breaks.

At one point I was referencing classes from other PHP files, so I was able to see how using the libraries interacts with my code and whatnot. Fun times! I could also probably use the include function to write my code and upload within Notepad++, refresh and see results over dealing with updating the article every time.
·
Friday, 03 July 2015 07:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello David,

Thanks for the sharing. I might be using it to improve my coding skill anytime soon!
·
Tuesday, 07 July 2015 15:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post