当前位置: 首页>>代码示例>>PHP>>正文


PHP ExampleForm::Run方法代码示例

本文整理汇总了PHP中ExampleForm::Run方法的典型用法代码示例。如果您正苦于以下问题:PHP ExampleForm::Run方法的具体用法?PHP ExampleForm::Run怎么用?PHP ExampleForm::Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExampleForm的用法示例。


在下文中一共展示了ExampleForm::Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: QLabel

        $this->flaSample->TemporaryUploadPath = __QCUBED_UPLOAD__;
        $this->flaSample->ClickToView = true;
        // NOTICE: If we are wanting users to immediately "click to view" files that are uploaded directly to the docroot,
        // we MUST take security precautions to prevent users from executing arbitrary code on the system.
        // Precautions could be: defining / overriding our own GetWebUrl() method in QFileAsset or
        // limiting the "types" of files that a user could upload.  We will go ahead and do this limiting here.
        $this->flaSample->FileAssetType = QFileAssetType::Image;
        // Feel free to uncomment this yourself, but note that you can pre-define the File property.
        // Notice how the path is an absolute path to a file.
        // Also notice that the file doesn't even need to be in the docroot.
        //			$this->flaSample->File = __DOCROOT__ . __IMAGE_ASSETS__ . '/calendar.png';
        // Add Styling
        $this->flaSample->CssClass = 'file_asset';
        $this->flaSample->imgFileIcon->CssClass = 'file_asset_icon';
        $this->lblMessage = new QLabel($this);
        $this->lblMessage->Text = 'Click on the button to change this message.';
        // The "Form Submit" Button -- notice how the form is being submitted via AJAX, even though we are handling
        // File Uploads on the form.
        $this->btnButton = new QButton($this);
        $this->btnButton->Text = 'Click Me';
        $this->btnButton->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click'));
        $this->btnButton->CausesValidation = true;
    }
    protected function btnButton_Click($strFormId, $strControlId, $strParameter)
    {
        $this->lblMessage->Text = 'Thanks for uploading the file: ' . $this->flaSample->FileName . ". File size: " . $this->flaSample->Size . " bytes";
    }
}
// And now run our defined form
ExampleForm::Run('ExampleForm', 'file_asset.tpl.php');
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:30,代码来源:file_asset.php

示例2: dtgPerson_BalanceRender

     * @param $item
     * @return string
     */
    public function dtgPerson_BalanceRender($item)
    {
        $val = $item->Budget - $item->Spent;
        if ($val < 0) {
            return '(' . number_format(-$val) . ')';
        } else {
            return number_format($val);
        }
    }
    /**
     * Style the number in the column. All number columns will use the amount class. If the number is negative, make
     * the cell red.
     *
     * @param $item
     * @return mixed
     */
    public function dtgPerson_BalanceAttributes($item)
    {
        $ret['class'] = 'amount';
        $val = $item->Budget - $item->Spent;
        if ($val < 0) {
            $ret['style'] = 'color:red';
        }
        return $ret;
    }
}
ExampleForm::Run('ExampleForm');
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:30,代码来源:column_values.php

示例3: Form_Create

require __INCLUDES__ . '/examples/examples.inc.php';
// Define the Qform with all our Qcontrols
class ExampleForm extends ExamplesBaseForm
{
    // Local declarations of our Qcontrols
    protected $lblMessage;
    protected $btnButton;
    // Initialize our Controls during the Form Creation process
    protected function Form_Create()
    {
        // Define the Label
        $this->lblMessage = new QLabel($this);
        $this->lblMessage->Text = 'Click the button to change my message.';
        // Define the Button
        $this->btnButton = new QButton($this);
        $this->btnButton->Text = 'Click Me!';
        // Add a Click event handler to the button -- the action to run is an AjaxAction.
        // The AjaxAction names a PHP method (which will be run asynchronously) called "btnButton_Click"
        $this->btnButton->AddAction(new QClickEvent(), new QAjaxAction('btnButton_Click'));
    }
    // The "btnButton_Click" Event handler
    protected function btnButton_Click($strFormId, $strControlId, $strParameter)
    {
        $this->lblMessage->Text = 'Hello, world!';
    }
}
// Run the Form we have defined
// We will explicitly specify an alternate filepath for the HTML template file.  Note
// that this filepath is relative to the path of this PHP script.
ExampleForm::Run('ExampleForm', 'some_template_file.tpl.php');
开发者ID:qcodo,项目名称:qcodo,代码行数:30,代码来源:alternate_template.php


注:本文中的ExampleForm::Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。