PHP code example of betobetok / ask-svg

1. Go to this page and download the library: Download betobetok/ask-svg library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

betobetok / ask-svg example snippets


$mySvg = svg('my_svg');
dd($mySvg);

Svg (string fileName, string contents, array attributes = []): mixed

public getStylefromContent(): string

public removeStylefromContent(): self

public style(): Configurators\Style

public setStyle(Configurators\Style style): self

public replaceClasses(Configurators\Style style, string content): string

public mergeSvgs(Svg[] param): Svg

public toHtml(): string

public getAllSvgElements(mixed svg): array

public cleanContent(): self

public getContent(): mixed

public setContent(mixed content): self

public removeSvgAttribute(): void

public getOnlySvgAttribute(): array

SvgElement (string name, string contents, array attributes = [], SvgElement context = null): mixed

public makeTransformable(): void

public makeUntransformable(): void

public name(string arg = &#039;&#039;): string|self

public id(string arg = &#039;&#039;): string|self

public transform(mixed arg = null): Transformation|string

public contents(): string

public removeContents(): self

public setContents(string contents): self

public getContext(): SvgElement|null

public getAllElements(): void

public setElement(string name, mixed element): void

public mergeAttributes(string tag, array attributes): array

public removeComents(): self

public toHtml(): string

public removeId(): self

public toArray(): void

public serialize(mixed data): mixed

public unserialize(mixed data): mixed

public findFirstGroupElement(string element): SvgElement|null

public findFirstElement(string elementName): SvgElement|null

public findFirstNonGroupElement(string element): SvgElement|null

public getElementAttributes(string tag): array

public getTransformations(): void

public getElementById(string id): SvgElement|null

public getStartPointById(string id): \NumPHP\Core\NumArray|null

public hasContext(): void

Shape (string contents, array attributes = [], SvgElement context = null): mixed

public getStartPosition(): void

protected renderAttributes(): string

public toHtml(): string

Circle (string contents, array attributes = [], SvgElement context = null): mixed

public center(): \NumPHP\Core\NumArray

public diameter(): float

public radio(): float

public area(): float

Ellipse (string contents, array attributes = [], SvgElement context = null): mixed

public center(): \NumPHP\Core\NumArray

public radioX(): float

public radioY(): float

public area(): float

Line (string contents, array attributes = [], SvgElement context = null): mixed

public long(): float

Path (string contents, array attributes = [], SvgElement context = null): mixed

public toHtml(): string

public content(): string

public getExistingComands(string d): array

protected renderAttributes(): string

Polygon (string contents, array attributes = [], SvgElement context = null): mixed

public toHtml(): string

public getPoints(string points): array

Polyline (string contents, array attributes = [], SvgElement context = null): mixed

public toHtml(): string

public getPoints(string points): array

Rect (string contents, array attributes = [], SvgElement context = null): mixed

public center(): \NumPHP\Core\NumArray

public area(): float

Text (string contents, array attributes = [], SvgElement context = null): mixed

Command (string type, array parameters = [], ?DCommands\Command prev = null): mixed

public initialization(mixed parameters): void

public getComand(): string

public setEndPoint(array relativePoint, array absolutePoint): void

public toHtml(): mixed

public getEndPoint(bool absolute = true): array

public resetNext(): void

public getLastMComand(): DCommands\Command|null

public getPoint(int n = null, bool absolute = false): array

public getDinstance(array fromPoint, array toPoint = []): array

public initialization(mixed parameters): void

public getCenter(int n = null): array

public initialization(mixed parameters): void

public initialization(mixed parameters): void

public getX(): float

public setX(float x): self

public initialization(mixed parameters): void

public initialization(mixed parameters): void

public getMDinstance(array toPoint = []): array

public getX(): float

public setX(float x): self

public getY(): float

public setY(float y): self

public initialization(mixed parameters): void

public initialization(mixed parameters): void

public initialization(mixed parameters): void

public initialization(mixed parameters): void

ASK\Svg\Svg ({)#427 ▼
  #name: "svg"
  #elements: array:1 [▼
    0 => ASK\Svg\Configurators\G ({)#301 ▼
      #name: "g"
      #elements: array:37 [▶]
      #context: ASK\Svg\Svg ({)#427(})
      #transforms: ASK\Svg\Transformation ({)#424 ▼
        #transformations: array:1 [▼
          0 => array:1 [▼
            "matrix" => NumPHP\Core\NumArray ({)#423 ▶(})
          ]
        ]
      (})
      #isTransformable: true
      -attributes: array:1 [▶]
      +"g": array:37 [▶]
    (})
  ]
  #context: null
  #isTransformable: false
  -attributes: array:6 [▼
    "id" => "my_svg"
    "width" => "473"
    "height" => "477"
    "viewBox" => "0 0 473 477"
    "fill" => "none"
    "xmlns" => "http://www.w3.org/2000/svg"
  ]
  +style: ASK\Svg\Configurators\Style ({)#426 ▼
    #name: "style"
    #context: ASK\Svg\Svg ({)#427(})
    #isTransformable: false
    -attributes: []
    -classes: []
    -rules: []
  (})
  +"g": array:1 [▼
    0 => ASK\Svg\Configurators\G ({)#301 ▶(})
  ]
(})
php
public getY(): float
php
public getPoint(mixed n = null, mixed absolute = true): array