This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

Embed PHP code in module

Published on| September 21st, 2009 | No Comment.
For those who can write PHP code, some of the articles that you can not write PHP code, you may feel inconvenient.

Basically, Joomla, plugins, modules, templates, PHP has a function to be interpolated to write code.
If necessary, plug-in for your module by creating a template, and the article has been able to tinker with the entire display.

However, other PHP code in Joomla! In if you want to reuse in the first Joomla! You still need according to the format. Therefore, to some extent, you often have to add the hand.
It色Nna for developers and users wish to use the PHP code may be troublesome task.

This time, the Joomla PHP Module is introduced, using the module, PHP is an extension that allows you to embed the code to the article.
PHP as a module embedded in the article of the code, it can be embedded, such as the first issue, some may be able to resolve.

Related articles:

Immediately, try using
Downloaded from the site where, gz file download and installation. (Menu [extension] - Install / Uninstall Please from. )

After installation, management Module , Click the Add New, [PHP Module] Create a new.

[PHP Module] Configuration screen, set each information.

Parameter name Description
Class Module: The name suffix of the module.
Enable Cashe: Enables the cache.
PHP,HTML,JS,CSS: PHP, HTML, JS, CSS and embed the code.
Evaluate PHP: PHP runs as a code.
Allow Discovery: For debugging, www.fijiwebdesign.com view copyright as HTML to embed in the article comments.

In these settings, the setting is, PHP, HTML, JS, CSS is about. After, almost, I think you can leave the default value.

If the display埋Me込Mitakunai copyright foundries, Allow Discovery Well and the good.

This time, the usual "Hello World!!" Let's show.
Hello World!!

Does, as a test, the following Plugin module in article use, let's see where PHP Module below.

(module [116] )

Fine, could see.
It is easy.

This time, the Joomla PHP Module Extension introduced with similar features are also filled.
This is a very simple and it was this time is up to the introduction.

If you check the contents of this module, you could understand, is very simple. Using PHP's eval is only running the code.

PHP, I know, Joomla mechanism, yet, and you can not understand, but for now, PHP code to be embedded in色Nna article, I can customize the way you want.
As also described earlier, PHP other libraries (such as my own code), etc. If you want to take advantage of the convenience I think. (Joomla Kitara accustomed to, I also make a good module)

※ described in the current directory where the PHP code, WEB is the root directory of your site. require_once and when you include the logical path can be read in it.


Leave a Reply

  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする