Onethink1.1 hooks and plugins for use!

Source: Internet
Author: User

Onethink download Please self-Baidu, installation will be a few seconds.

Master (slightly), just for and I need to know the rookie.

The main talk about the use of Onethink plug-in, because it is useful for our rapid development, so record, but also hope to help the friends who are trying to understand.

we start with the hooks, First look at the following background interface:

Step1. Select "New"

Step2. Fill in the required form (the hook name is unique), then click "OK" to prompt the creation of the success.

The hooks are created.

Next:

Step4. A hook is called, find the template that needs to be called, add the following statement: {: Hook (' Bannerimageslide ')}

Note: It is hook, not hooks;

Next:

Step5. Click "Quick Create" on "plugin management"

Next:

Step6. Select or fill in as needed, and click "OK".

Next:

Step7. Click Install.

Return files to view the generated directories and files:

Imageslide directory and config.php,imageslideaddon.class.php two files were generated under./addons/

How do we see the effect of our plugins under your own hooks?

Find the method of your hook in the class and print it for a try.

If the calling location prints the echo information in the plugin just now, the description can be called. If there is no call, you need to double-check to see if there is no call to the location.

How does the plugin write?

Next, write the plugin template:

Step9. The content in the question mark is the variable assigned to the template, which can be represented first with a placeholder.

It's worth mentioning that writing a plugin template is no different from our HTML page. It is also possible to introduce resources such as css,js,images required by plugins in the page.

Assign variables in the plug-in class:

The configuration here is not very convenient to explain, explained later.

Once configured, you can use the plug-in's "settings" action

Not configured before:

After adding the plug-in configuration information:

Step10. If the settings action does not appear, first uninstall, and then install. Click "Settings";

Next:

Step11. Fill in the values you want to display

Step13. Click "OK".

Next:

Step15. Locate the plug-in class file, and obtain the configuration information and assign the variable to the template file content.html

As a result, the next step is to get the value of the variable in the plugin template.

Next:

Final effect

Note If the value in the red box is not obtained, it is likely that you did not set the value in the plug-in "settings".

Hope for the needs of friends to help, the next step is to use a plugin to create a picture scrolling effect.

Onethink1.1 hooks and plugins for use!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.