SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 151 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

This allows us to perform additional processing that we may not be
able to do using the XML manifest file.
The install file normally includes a function called com_install(). This function is
used to execute additional processing that we may want/need during installation of
our component. If anything fails during the function, we can return Boolean false.
This will abort the extension installation.
We can also use the install file to output information. This is used for two different
purposes: to display some message that explains something about the component
and to show the success or failure of any processing.
This example shows how we can use the com_install() function. Note that this is
executed after the rest of the XML manifest file has been successfully processed.
/**
* Some Component installation script
*
* @return boolean false on fail
*/
Component Design
[ 112 ]
function com_install()
{
$return = true;
echo '
';
// do some task
echo JText::_('Doing Something').': ';
if (dosomething())
{
echo JText::_('Success');
}
else
{
echo JText::_('Fail');
}
echo '
';
if ($return)
{
echo '

'
.


Pages:
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163