PHP Classes

File: tests/src/response/TestComponent.php

Recommend this page to a friend!
  Packages of Thierry Feuzeu   Jaxon   tests/src/response/TestComponent.php   Download  
File: tests/src/response/TestComponent.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon
Call PHP classes from JavaScript using AJAX
Author: By
Last change:
Date: 1 year ago
Size: 1,879 bytes
 

Contents

Class file image Download
<?php

use Jaxon\App\NodeComponent;

class TestComponent extends NodeComponent
{
    public function html(): string
    {
        return '';
    }

    public function confirm()
    {
        $this->response->jq('target')->click($this->rq()->render()->confirm('Do?'));
    }

    public function confirmElseWarning()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->confirm('Do?')->elseWarning('Warning'));
    }

    public function confirmElseError()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->confirm('Do?')->elseError('Error'));
    }

    public function ifeq()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifeq('1', 1)->elseInfo('Info'));
    }

    public function ifteq()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifteq('1', 1)->elseInfo('Info'));
    }

    public function ifne()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifne('1', 1)->elseInfo('Info'));
    }

    public function ifnte()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifnte('1', 1)->elseInfo('Info'));
    }

    public function ifgt()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifgt(10, 1)->elseSuccess('Success'));
    }

    public function ifge()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifge(10, 1)->elseSuccess('Success'));
    }

    public function iflt()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->iflt(10, 1)->elseSuccess('Success'));
    }

    public function ifle()
    {
        $this->response->jq('target')->click($this->rq()->render()
            ->ifle(10, 1)->elseSuccess('Success'));
    }
}