ThinkPHP, thinkphp Official Website

Source: Internet
Author: User

ThinkPHP, thinkphp Official Website

Solution: The OneThink site cannot be recognized by the uyan background.

Enable the uyan plug-in function, but the OneThink site cannot be detected by the uyan background. The uyan code generated on the page is:

1 <!-- UY BEGIN -->2 <div id="uyan_frame"></div>3 <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid="></script>4 <!-- UY END -->

You will find that the uid is not set. View the uyan code in \ Addons \ SocialComment \ comment.html.

1 <!-- UY BEGIN -->2 <div id="uyan_frame"></div>3 <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid={$addons.config.comment_uid_youyan}"></script>4 <!-- UY END -->

You will find that the variable $ addons. config is incorrect and should be $ addons_config.

Solution: Change $ addons. config to $ addons_config.

References:

How the onethink plug-in runs the http://jingyan.baidu.com/article/8275fc86b4226146a03cf6d7.html

Hooks in OneThink initialize to the running process http://www.thinkphp.cn/topic/13867.html

Onethink beta1 plugin complete documentation http://www.thinkphp.cn/topic/7058.html

Template rendering (change the VIEW template file)

After the template is defined, the template output can be rendered. The system also supports direct rendering of content output. The template assignment must be performed before the template rendering.

The display method is commonly used for rendering template output. Call format:

Display ('[template file]' [, 'encoding '] [, 'output type'])

If the template file is not defined according to the template definition rules (or a template under another controller needs to be called), you can use:

1 $this->display('Member:read');

Indicates calling the read Template under the Member module. Rendering output does not need to write the path and suffix of the template file. To be exact, the controllers and operations here do not necessarily need to have the actual controllers and operations, it's just a directory name and a file name.

References: Template rendering http://document.thinkphp.cn/manual_3_2.html#template_display

Default left Navigation in OneThink

Navigation on the left side of the page is defined in \ Application \ Home \ View \ default \ Public \ body.html:

1 <div class="span3 bs-docs-sidebar">2     <block name="publish"></block>3     <ul class="nav nav-list bs-docs-sidenav">4         {:W('Category/lists', array($category['id'], ACTION_NAME == 'index'))}5     </ul>6 </div>

Specifically, {: W ('category/lists', array ($ Category ['id'], ACTION_NAME = 'index')} calls a plug-in (Widget ), in \ Application \ Home \ Widget \ CategoryWidget. class. defined in php.

ACTION_NAME is a constant of ThinkPHP, indicating "current operation name ".

References: Several methods of http://www.7ak8.com/a/wangzhankaifa/PHP/2015/0109/1176.html for OneThink front-end template display

 

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.