PHP Development Framework Yii Framework Tutorial (UI component Clipwidget example)

Source: Internet
Author: User
Tags php framework yii
Cclipwidget provides the ability to record "macros", and the content defined between Init and run of Cclipwidget can be stored in the controller's clip variable and replayed back to any other location.

Cclipwidget encapsulates the basic usage of beginclip and endclip for Cbasecontroller Beginclip and Endclip,cbasecontroller as follows:

First define Clip

$this->beginclip (' clipid ');//... display the clip contents$this->endclip ();

And then we need to use this clip.

echo $this->clips[' clipid '];

If $this points to not a controller, but a widget, you can use the

echo $this->getcontroller ()->clips [' Clipid '];

Here's how to use Clipwidget,

Beginwidget (' Cclipwidget ', array (' id ' = ' record '));? >endwidget (); >clips[' record '];?>----------- clips[' record ';?>

The first is also the definition of clip, which is defined by Beginwidget and Endwidget, and the clip ID is passed in by the parameter ID. Then you can call echo $this->clips[' record ']; Show the recorded content where it is needed. The content between Beginwidget and Endwidget can be customized as needed, and this example displays three lines of text.

The results appear as follows:

The above is the content of the PHP Framework Yii Framework Tutorial (Clipwidget) UI component sample, more about topic.alibabacloud.com (www.php.cn)!

  • 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.