2011-05-05 7 views
1

나는 joomla 사이트에 대한 몇 가지 모듈을 만드는 임무를 받고 있지만 joomla (전형적인, 오른쪽)에 대한 경험이 없습니다. 어쨌든 나는 배변과 진동 장치가 만날 때까지 약간의 시간이있어 그래서 나는 joomla에 익숙해졌습니다. joomla 사이트에서 mod_helloworld 튜토리얼을 사용할 수 있었지만 확장 관리자에 모듈이 표시되지 않습니다. 모든 도움/설명을 부탁드립니다. ,Joomla 초보자 모듈 질문

이 모듈 디렉토리에 mod_hellworld 디렉토리를 만들고 거기에 mod_helloworld.php, helper.php, mod_helloworld.xml하는 tmpl 디렉토리와 배치 default.php 파일을 추가 : 이것은 내가 무슨 짓을

.

다음은 XML 파일입니다.

<?xml version="1.0" encoding="utf-8"?> 
<extension type="module" version="1.6.0" client="site" method="upgrade"> 
    <name>Hello World!</name> 
    <author>Steve Suranie</author> 
    <version>1.6.0</version> 
    <description>Simple Hello World module.</description> 
    <files> 
     <filename module="mod_helloworld">mod_helloworld.php</filename> 
     <filename>mod_helloworld.xml</filename> 
     <filename>index.html</filename> 
     <filename>helper.php</filename> 
     <filename>tmpl/default.php</filename> 
     <filename>tmpl/index.html</filename> 
    </files> 
</extension> 

mod_helloworld.php

<?php 
class modHelloWorldHelper { 
    /** 
    * Retrieves the hello message 
    * 
    * @param array $params An object containing the module parameters 
    * @access public 
    */  
    function getHello($params) { 
     return 'Hello, World!'; 
    } 
} 
?> 

답변

3

모듈 줌라에 등록해야

<?php 
    defined('_JEXEC') or die; // no direct access allowed 

    require_once dirname(__FILE__).DS.'helper.php'; // get helper files 

    $hello = modHelloWorldHelper::getHello($params); 
    require JModuleHelper::getLayoutPath('mod_helloworld'); 
?> 

helper.php. 다음은이를 수행하는 방법입니다.

  • modules 디렉토리에서 폴더를 제거하십시오. 파일을 압축하십시오 (예 : winzip 사용). joomla administration에서 &을 설치하십시오.
  • 또는, 모듈 디렉토리에 폴더를 유지하고
(설치 과정을 변경하지 않은 경우 'jos_'이 될 것이다 데이터베이스 접두사) 데이터베이스 테이블 'jos_modules'에서이 모듈에 대한 항목을 추가 할 수 있습니다
+0

승리를위한 sv_in! 2 분 동안 수락 할 수 없지만 그렇게 할 것입니다. – PruitIgoe