Skip to content

Commit

Permalink
Update documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
anklimsk committed Dec 14, 2018
1 parent 127d166 commit e401c44
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Full UI theme for CakePHP
- Using additional `JS` and `CSS` files in `main` layout;
- Retrieving list of specific CSS or JS files for action of controller;
- Rendering CakePHP Flash message using `Noty` or` Bootstrap`;
- Rendering styled information on error or exception;
- Creating tour of the application;
- Filter for table data with a group action, data export and printing;
- Pagination controls elements:
Expand All @@ -35,7 +36,8 @@ Full UI theme for CakePHP
* drop down input;
* checkbox and radio button;
* password input with checking Caps Lock;
* text input with autocomplete, input mask or focus.
* text input with autocomplete, input mask or focus;
* textarea input with autocomplete.
- Creating page header with small menu with typical actions;
- Creating tooltips;
- Creating time ago block;
Expand Down
13 changes: 13 additions & 0 deletions docs/BREADCRUMBS_NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@
$this->set(compact('breadCrumbs'));
```

or

```php
$breadCrumbs = $this->Model->AssocModel->getBreadcrumbInfo($refId);
$link = ['action' => 'view', $refId];
$breadCrumbs[] = $this->Model->createBreadcrumb(null, $link);
if (!empty($id)) {
$breadCrumbs[] = $this->Model->createBreadcrumb($id, false);
}

$this->set(compact('breadCrumbs'));
```

3. In your `View` add:
- Adds a link to the breadcrumbs array:

Expand Down
46 changes: 45 additions & 1 deletion docs/FORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Where:
Example of text input with autocomplete

```php
echo $this->Form->text($fieldName, ['data-toggle' => 'autocomplete']);
echo $this->Form->text($fieldName, $options + ['data-toggle' => 'autocomplete']);
echo $this->Form->autocomplete($fieldName, $options);
```

Expand All @@ -374,3 +374,47 @@ Where:
* `local` - Local data for autocomplete;
* `min-length` - minimal length of query string.
See https://github.com/bassjobsen/Bootstrap-3-Typeahead

### Textarea input with autocomplete

Example of textarea input with autocomplete

```php
echo $this->Form->text($fieldName, $options + ['data-toggle' => 'textcomplete']);
echo $this->Form->textarea($fieldName, $options + ['data-toggle' => 'textcomplete']);
```

Where:
- `$fieldName` Name of a field, like this "Modelname.fieldname"
- `$options` Array of HTML attributes and widget options:
* `data-textcomplete-strategies`- Array of strategies, e.g.:
+ `match`, `replace`.
+ `ajaxOptions`: A set of key/value pairs that configure the Ajax request.
See https://github.com/yuku/textcomplete

Example options:

```php
$strategies = [
[
'ajaxOptions' => [
'url' => $this->Html->url(['controller' => 'variables', 'action' => 'autocomplete', 'ext' => 'json']),
'data' => [
'ref-type' => 'some-type',
'ref-id' => 'some-id',
]
],
'match' => '(%)(\w+)$',
'replace' => 'return "$1" + value + "%";'
]
];

$ptions = [
'label' => __('Label') . ':',
'title' => __('Tooltip.'),
'type' => 'textarea',
'rows' => 4,
'data-toggle' => 'textcomplete',
'data-textcomplete-strategies' => json_encode($strategies)
];
```
8 changes: 8 additions & 0 deletions docs/LINKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@
echo $this->ViewExtension->popupLink($title, $url, $options);
echo $this->Html->link($title, $url, ['data-toggle' => 'popover']);

// `Popover` link with popover window size
echo $this->ViewExtension->popupLink($title, $url, $options + ['data-popover-size' => 'lg']);
echo $this->Html->link($title, $url, ['data-toggle' => 'popover', 'data-popover-size' => 'lg']);

// `Modal` link
echo $this->ViewExtension->modalLink($title, $url, $options);
echo $this->Html->link($title, $url, ['data-toggle' => 'modal']);

// `Modal` link with modal window size
echo $this->ViewExtension->modalLink($title, $url, $options + ['data-modal-size' => 'lg']);
echo $this->Html->link($title, $url, ['data-toggle' => 'modal', 'data-modal-size' => 'lg']);
```

Where:
Expand Down

0 comments on commit e401c44

Please sign in to comment.