Skip to header Skip to main navigation Skip to main content Skip to footer

User account menu

  • Log in
Home
Blog

Main navigation

  • Forum
  • Home

MosModule: How to use snippet?

Breadcrumb

  • Home
  • MosModule FAQ
  • MosModule: How to use snippet?
By ongetc | 9:20 PM MDT, Sun October 04, 2009

What is snippet?

Snippet is just php code that MosModule will execute just like you put php in your article but without all the php intermix inside your article. It turn your article into php program! Another words snippet is inline PHP code but nicely file away and just reference it with an article ID.

How to use snippet?

First you just need to create a content that you can put your php code in it but without < ?php ? > and give it a name and take note of the article ID.

Then in the article that you want to use snippet just do something like this:

{mosmodule snippet=ArticleID}

You can call as many snippet as you want just like you would with php function but in this case it is more of a block of php code that you want to run in your content.

The thing that you need to be aware is that all your variables that executed in any snippet will be available through out your content.

What is that mean, it mean you can define function in any of the snippet that you execute prior in the later snippet calling!

You can even add some HTML code in your article to wrap around your snippet if your snippet output something! This will help to do code and design separation!

It is open for all kind of possibilities!

Book traversal links for MosModule FAQ

  • ‹ MosModule: How to show contact form in content?
  • Up
  • MosModule: Show MosCom latest 5? ›
  • Printer-friendly version

Reseller hosting (free)

Hosting24 (w/ ssh)

A2 Hosting

Popular content

MosDashBoard4SB
COAddOns
MosModule: How to show contact form in content?
MosModule: How to use snippet?
MosModule: Can MosModule be used in custom HTML module?
MosModule
MosCom
MoseCMS
MosPrayerLatestX
MosNewsWriter
Pagination
  • Current page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • …
  • Next page next ›
  • Last page »
more
Subscribe to Syndicate

Copyright © 2026 OngETC - All rights reserved

Developed and Designed by CO