Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [php]

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Joomla is based on PHP.

10
votes
2answers
2k views

What's the difference between JHtml:script() and $doc->addScript?

I developed a module recently that required certain JS and CSS files to be injected into the <head> of each page. Initially, I used: $doc =& JFactory::getDocument(); $doc->addScript(JURI:...
11
votes
3answers
3k views

Best method to check if a component is installed/enabled?

Between joomla 2.5 and 3.x what is the best way to check if another component is installed and/or enabled? There exist a helper class called JComponentHelper but I believe the isEnabled function will ...
5
votes
1answer
695 views

Gantry PHP Notice: Undefined property: Gantry::$belatedPNG

So I'm running the master Gantry template however I'm constantly hitting the following PHP notice in my error log - like 20/30 times a day: PHP Notice: Undefined property: Gantry::$belatedPNG in /...
19
votes
3answers
7k views

Whats the correct way for exception handling?

In Joomla core I find still many calls like this: // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); ...
8
votes
3answers
5k views

How do I pull data from a K2 extra field that is an array?

I'm building a site that uses K2 extra fields, but I'm customizing the output so I'm not just pulling the entire extra field block. Normally something like this works for single entry fields: <?...
3
votes
4answers
717 views

Override default php session

I'm building a AngularJs app using joomla in background. The AngularJs app get loaded once and then calls the server always through ajax. Some calls happen simultaneously. If I'm using the default PHP ...
7
votes
3answers
267 views

How to resolve `Strict standards` warning for different method signatures across Joomla versions

In updating an extension to support Joomla 3.x we've run into a few cases where the signature for a function has changed since 2.5 and results in a Strict standards warning. For example in the JTable ...
7
votes
1answer
3k views

SMTP no error but not sending email

I have been battling with this for some time now. I have built a custom component for forms and it uses Joomla's mail functions to send email. I have checked all the data to make sure it is correct ...
26
votes
3answers
10k views

What's the proper way to get the entire $_POST?

In Joomla! 2.5.x I could simply run JRequest::get('post'); but seeing as JRequest is deprecated in Joomla! 3.x I should use JInput. At them moment this is the code I'm using to get the entire $_POST: ...
7
votes
3answers
7k views

How do I generate a SEF URL in a custom module instead of the real URL?

In my module, this code is being used to generate the URL of the page: JURI::base() . ContentHelperRoute::getArticleRoute( $article->id, $article->catid ) This works exaclty as it should and ...
16
votes
9answers
10k views

How to improve server response time?

What can I do, other than using a cache plugin like jotcache, to improve the server response time of my website? I have already removed all inactive articles modules, plugins and components, is there ...
7
votes
3answers
3k views

Custom menu get title of the active menu's parent item

I can get the title of the active menu using $menu = &Jsite::getMenu(); $menuname = $menu->getActive()->title; But how can I access it's parent title?
30
votes
4answers
4k views

Method for creating a subquery using JDatabase

At http://docs.joomla.org/Selecting_data_using_JDatabase, there isn't a documented method for writing a subquery using JDatabase. https://gist.github.com/gunjanpatel/8663333 exemplifies one way of ...