Skip to content

Commit

Permalink
fixed some broken links and markdown in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Aug 8, 2023
1 parent 548a670 commit 052fee3
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 83 deletions.
2 changes: 1 addition & 1 deletion docs/api/variables/assigning.md
Expand Up @@ -22,7 +22,7 @@ footer.tpl:
<small>Copyright {$companyName|escape}</small>
```

Smarty will apply the [escape modifier](../designers/language-modifiers/language-modifier-escape.md)
Smarty will apply the [escape modifier](../../designers/language-modifiers/language-modifier-escape.md)
to the value assigned to the variable
`companyName` and replace `{$companyName|escape}` with the result.

Expand Down
13 changes: 6 additions & 7 deletions docs/api/variables/config-files.md
Expand Up @@ -27,7 +27,7 @@ Intro = """This is a value that spans more

```

Values of [config file variables](./language-variables/language-config-variables.md) can be in
Values of [config file variables](../../designers/language-variables/language-config-variables.md) can be in
quotes, but not necessary. You can use either single or double quotes.
If you have a value that spans more than one line, enclose the entire
value with triple quotes \("""\). You can put comments into config
Expand Down Expand Up @@ -81,9 +81,8 @@ $smarty->setConfigOverwrite(false);
When config overwrite is disabled, Smarty will create arrays of config file variables when it encounters
multiple entries with the same name.

See also [`{config_load}`](./language-builtin-functions/language-function-config-load.md),
[`$config_overwrite`](../programmers/api-variables/variable-config-overwrite.md),
[`$default_config_handler_func`](../programmers/api-variables/variable-default-config-handler-func.md),
[`getConfigVars()`](../programmers/api-functions/api-get-config-vars.md),
[`clearConfig()`](../programmers/api-functions/api-clear-config.md) and
[`configLoad()`](../programmers/api-functions/api-config-load.md)
See also [`{config_load}`](../../designers/language-builtin-functions/language-function-config-load.md),
[`$default_config_handler_func`](../../programmers/api-variables/variable-default-config-handler-func.md),
[`getConfigVars()`](../../programmers/api-functions/api-get-config-vars.md),
[`clearConfig()`](../../programmers/api-functions/api-clear-config.md) and
[`configLoad()`](../../programmers/api-functions/api-config-load.md)
2 changes: 1 addition & 1 deletion docs/api/variables/objects.md
Expand Up @@ -55,7 +55,7 @@ You can restrict the methods and properties that can be accessed by
listing them in an array as the third registration parameter.

By default, parameters passed to objects through the templates are
passed the same way [custom functions](../../designers/language-custom-functions/index.md) get
passed the same way [custom tags](../../designers/language-custom-functions/index.md) get
them. An associative array is passed as the first parameter, and the
smarty object as the second. If you want the parameters passed one at a
time for each argument like traditional object parameter passing, set
Expand Down
6 changes: 3 additions & 3 deletions docs/designers/language-basic-syntax/index.md
Expand Up @@ -14,20 +14,20 @@ A simple Smarty template could look like this:

All Smarty template tags are enclosed within delimiters. By default
these are `{` and `}`, but they can be
[changed](../../programmers/api-variables/variable-left-delimiter.md).
[changed](../../designers/language-basic-syntax/language-escaping.md).

For the examples in this manual, we will assume that you are using the
default delimiters. In Smarty, all content outside of delimiters is
displayed as static content, or unchanged. When Smarty encounters
template tags, it attempts to interpret them, and displays the
appropriate output in their place.

The basis components of the Smarty syntax are:
The basic components of the Smarty syntax are:

- [Comments](language-syntax-comments.md)
- [Variables](language-syntax-variables.md)
- [Operators](language-syntax-operators.md)
- [Functions](language-syntax-functions.md)
- [Tags](language-syntax-tags.md)
- [Attributes](language-syntax-attributes.md)
- [Quotes](language-syntax-quotes.md)
- [Escaping](language-escaping.md)
7 changes: 3 additions & 4 deletions docs/designers/language-basic-syntax/language-escaping.md
Expand Up @@ -45,8 +45,7 @@ variables.
Smarty's default delimiters { and } cleanly represent presentational
content. However, if another set of delimiters suit your needs better,
you can change them with Smarty's
[`$left_delimiter`](../../programmers/api-variables/variable-left-delimiter.md) and
[`$right_delimiter`](../../programmers/api-variables/variable-right-delimiter.md) values.
`setLeftDelimiter()` and `setRightDelimiter()` methods.

> **Note**
>
Expand All @@ -57,8 +56,8 @@ you can change them with Smarty's
```php
<?php

$smarty->left_delimiter = '<!--{';
$smarty->right_delimiter = '}-->';
$smarty->setLeftDelimiter('<!--{');
$smarty->setRightDelimiter('}-->');

$smarty->assign('foo', 'bar');
$smarty->assign('name', 'Albert');
Expand Down
@@ -1,6 +1,6 @@
# Attributes

Most of the [functions](./language-syntax-functions.md) take attributes that
Most of the [tags](./language-syntax-tags.md) take attributes that
specify or modify their behavior. Attributes to Smarty functions are
much like HTML attributes. Static values don't have to be enclosed in
quotes, but it is required for literal strings. Variables with or
Expand Down
@@ -1,7 +1,7 @@
# Comments

Template comments are surrounded by asterisks, and that is surrounded by
the [delimiter](../../programmers/api-variables/variable-left-delimiter.md) tags like so:
the [delimiter](../../designers/language-basic-syntax/language-escaping.md) tags like so:

## Examples

Expand Down
@@ -1,4 +1,4 @@
# Functions
# Tags

Every Smarty tag either prints a [variable](./language-syntax-variables.md) or
invokes some sort of function. These are processed and displayed by
Expand Down Expand Up @@ -31,8 +31,8 @@ within delimiters like so: `{funcname attr1="val1" attr2="val2"}`.
[`{strip}`](../language-builtin-functions/language-function-strip.md). There should be no need to
change or modify them.

- Custom functions are **additional** functions implemented via
[plugins](../../programmers/plugins.md). They can be modified to your liking, or you can
- Custom tags are **additional** tags implemented via
[plugins](../../api/extending/introduction.md). They can be modified to your liking, or you can
create new ones. [`{html_options}`](../language-custom-functions/language-function-html-options.md)
is an example of a custom function.

Expand Down
2 changes: 1 addition & 1 deletion docs/designers/language-builtin-functions/index.md
Expand Up @@ -4,7 +4,7 @@ Smarty comes with several built-in functions. These built-in functions
are the integral part of the smarty template engine. They are compiled
into corresponding inline PHP code for maximum performance.

You cannot create your own [custom functions](../language-custom-functions/index.md) with the same name; and you
You cannot create your own [custom tags](../language-custom-functions/index.md) with the same name; and you
should not need to modify the built-in functions.

A few of these functions have an `assign` attribute which collects the
Expand Down
Expand Up @@ -2,7 +2,7 @@

`{block}` is used to define a named area of template source for template
inheritance. For details see section of [Template
Inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md).
Inheritance](../../api/inheritance.md).

The `{block}` template source area of a child template will replace the
corresponding areas in the parent template(s).
Expand Down Expand Up @@ -195,7 +195,7 @@ The result would look like
```

See also [Template
Inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md),
Inheritance](../../api/inheritance.md),
[`$smarty.block.parent`](../language-variables/language-variables-smarty.md#smartyblockparent-languagevariablessmartyblockparent),
[`$smarty.block.child`](../language-variables/language-variables-smarty.md#smartyblockchild-languagevariablessmartyblockchild), and
[`{extends}`](./language-function-extends.md)
Expand Up @@ -2,15 +2,15 @@

`{extends}` tags are used in child templates in template inheritance for
extending parent templates. For details see section of [Template
Inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md).
Inheritance](../../api/inheritance.md).

- The `{extends}` tag must be on the first line of the template.

- If a child template extends a parent template with the `{extends}`
tag it may contain only `{block}` tags. Any other template content
is ignored.

- Use the syntax for [template resources](../../programmers/resources.md) to extend files
- Use the syntax for [template resources](../../api/resources.md) to extend files
outside the [`$template_dir`](../../programmers/api-variables/variable-template-dir.md) directory.

## Attributes
Expand All @@ -33,5 +33,5 @@ Inheritance](../../programmers/advanced-features/advanced-features-template-inhe
{extends 'parent.tpl'} {* short-hand *}
```

See also [Template Inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md)
See also [Template Inheritance](../../api/inheritance.md)
and [`{block}`](./language-function-block.md).
Expand Up @@ -41,7 +41,7 @@ available within the included template.
is useful to return values from the included template to the
including template.

- Use the syntax for [template resources](../../programmers/resources.md) to `{include}`
- Use the syntax for [template resources](../../api/resources.md) to `{include}`
files outside of the [`$template_dir`](../../programmers/api-variables/variable-template-dir.md)
directory.

Expand Down Expand Up @@ -183,5 +183,5 @@ current template.
{include file="$style_dir/$module.$view.tpl"}
```
See also [template resources](../../programmers/resources.md) and
See also [template resources](../../api/resources.md) and
[componentized templates](../../appendixes/tips.md#componentized-templates).
Expand Up @@ -4,7 +4,7 @@
template delimiters, by default **{** and **}**. You can also use
[`{literal}{/literal}`](./language-function-literal.md) to escape blocks of
text eg Javascript or CSS. See also the complementary
[`{$smarty.ldelim}`](../../programmers/api-variables/variable-left-delimiter.md).
[`{$smarty.ldelim}`](../../designers/language-basic-syntax/language-escaping.md).

```smarty
{* this will print literal delimiters out of the template *}
Expand Down
Expand Up @@ -3,7 +3,7 @@
`{literal}` tags allow a block of data to be taken literally. This is
typically used around Javascript or stylesheet blocks where {curly
braces} would interfere with the template
[delimiter](../../programmers/api-variables/variable-left-delimiter.md) syntax. Anything within
[delimiter](../../designers/language-basic-syntax/language-escaping.md) syntax. Anything within
`{literal}{/literal}` tags is not interpreted, but displayed as-is. If
you need template tags embedded in a `{literal}` block, consider using
[`{ldelim}{rdelim}`](./language-function-ldelim.md) to escape the individual
Expand Down
2 changes: 1 addition & 1 deletion docs/designers/language-custom-functions/index.md
@@ -1,4 +1,4 @@
# Custom Functions
# Custom Tags

Smarty comes with several custom plugin functions that you can use in
the templates.
Expand Down
Expand Up @@ -22,7 +22,7 @@ output to the template.
> templates.
>
> - Evaluated variables are compiled on every invocation, the compiled
> versions are not saved! However, if you have [caching](../../programmers/caching.md)
> versions are not saved! However, if you have [caching](../../api/caching/basics.md)
> enabled, the output will be cached with the rest of the template.
>
> - If the content to evaluate doesn't change often, or is used
Expand Down
Expand Up @@ -28,7 +28,7 @@ ftp and display the contents.
> If security is enabled, and you are fetching a file from the local
> file system, `{fetch}` will only allow files from within the
> `$secure_dir` path of the security policy. See the
> [Security](../../programmers/advanced-features/advanced-features-security.md) section for details.
> [Security](../../api/security.md) section for details.
- If the `assign` attribute is set, the output of the `{fetch}`
function will be assigned to this template variable instead of being
Expand Down
Expand Up @@ -20,7 +20,7 @@ automatically calculated from the image file if they are not supplied.
from. If not given, the web server's document root
`$_ENV['DOCUMENT_ROOT']` is used as the base. If security is
enabled, then the image must be located in the `$secure_dir` path of
the security policy. See the [Security](../../programmers/advanced-features/advanced-features-security.md)
the security policy. See the [Security](../../api/security.md)
section for details.

- `href` is the href value to link the image to. If link is supplied,
Expand All @@ -37,7 +37,7 @@ automatically calculated from the image file if they are not supplied.
>
> `{html_image}` requires a hit to the disk to read the image and
> calculate the height and width. If you don't use template
> [caching](../../programmers/caching.md), it is generally better to avoid `{html_image}`
> [caching](../../api/caching/basics.md), it is generally better to avoid `{html_image}`
> and leave image tags static for optimal performance.
## Examples
Expand Down
@@ -1,6 +1,6 @@
# {textformat}

`{textformat}` is a [block function](../../programmers/plugins/plugins-block-functions.md) used to
`{textformat}` is a block tag used to
format text. It basically cleans up spaces and special characters, and
formats paragraphs by wrapping at a boundary and indenting lines.

Expand Down
4 changes: 2 additions & 2 deletions docs/designers/language-modifiers/index.md
@@ -1,7 +1,7 @@
# Variable Modifiers

Variable modifiers can be applied to
[variables](../language-variables/index.md), [custom functions](../language-custom-functions/index.md)
[variables](../language-variables/index.md), [custom tags](../language-custom-functions/index.md)
or strings. To apply a modifier,
specify the value followed by a `|` (pipe) and the modifier name. A
modifier may accept additional parameters that affect its behavior.
Expand Down Expand Up @@ -102,4 +102,4 @@ These parameters follow the modifier name and are separated by a `:`

See also [`registerPlugin()`](../../programmers/api-functions/api-register-plugin.md), [combining
modifiers](../language-combining-modifiers.md). and [extending smarty with
plugins](../../programmers/plugins.md)
plugins](../../api/extending/introduction.md)
4 changes: 2 additions & 2 deletions docs/designers/language-variables/index.md
Expand Up @@ -8,11 +8,11 @@ variable depends on what symbol it is prefixed or enclosed within.
- [{$smarty} reserved variable](language-variables-smarty.md)

Variables in Smarty can be either displayed directly or used as
arguments for [functions](../language-basic-syntax/language-syntax-functions.md),
arguments for [tags](../language-basic-syntax/language-syntax-tags.md),
[attributes](../language-basic-syntax/language-syntax-attributes.md) and
[modifiers](../language-modifiers/index.md), inside conditional expressions, etc.
To print a variable, simply enclose it in the
[delimiters](../../programmers/api-variables/variable-left-delimiter.md) so that it is the only thing
[delimiters](../../designers/language-basic-syntax/language-escaping.md) so that it is the only thing
contained between them.

```smarty
Expand Down
Expand Up @@ -110,7 +110,7 @@ zaphod@slartibartfast.example.com<br />

## Objects

Properties of [objects](../../programmers/advanced-features/advanced-features-objects.md) assigned from PHP
Properties of [objects](../../api/variables/objects.md) assigned from PHP
can be referenced by specifying the property name after the `->` symbol.

```smarty
Expand Down
Expand Up @@ -138,12 +138,12 @@ Returns the version of Smarty the template was compiled with.
## {$smarty.block.child}

Returns block text from child template. See [Template
inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md).
inheritance](../../api/inheritance.md).

## {$smarty.block.parent}

Returns block text from parent template. See [Template
inheritance](../../programmers/advanced-features/advanced-features-template-inheritance.md)
inheritance](../../api/inheritance.md)

## {$smarty.ldelim}, {$smarty.rdelim}

Expand Down
33 changes: 16 additions & 17 deletions docs/features.md
@@ -1,36 +1,35 @@
Features
=======
# Features

Some of Smarty's features:

- It is extremely fast.
- It is efficient since the PHP parser does the dirty work.
- No template parsing overhead, only compiles once.
- It is smart about [recompiling](#variable.compile.check) only the
- It is smart about recompiling only the
template files that have changed.
- You can easily create your own custom
[functions](#language.custom.functions) and [variable
modifiers](#language.modifiers), so the template language is
[tags](api/extending/tags.md) and [modifiers](api/extending/modifiers.md), so the template language is
extremely extensible.
- Configurable template [{delimiter}](#variable.left.delimiter) tag
- Configurable template [{delimiter}](designers/language-basic-syntax/language-escaping.md) tag
syntax, so you can use `{$foo}`, `{{$foo}}`, `<!--{$foo}-->`, etc.
- The [`{if}..{elseif}..{else}..{/if}`](#language.function.if)
- The [`{if}..{elseif}..{else}..{/if}`](designers/language-builtin-functions/language-function-if.md)
constructs are passed to the PHP parser, so the `{if...}` expression
syntax can be as simple or as complex an evaluation as you like.
- Allows unlimited nesting of
[`sections`](#language.function.section), `if's` etc.
- Built-in [caching](#caching) support
- Arbitrary [template](#resources) sources
- [Template Inheritance](#advanced.features.template.inheritance) for
[`sections`](designers/language-builtin-functions/language-function-section.md), `if's` etc.
- Built-in [caching](api/caching/basics.md) support
- Arbitrary [template](api/resources.md) sources
- [Template Inheritance](api/inheritance.md) for
easy management of template content.
- [Plugin](#plugins) architecture
- [Plugin](api/extending/introduction.md) architecture

## Separation of presentation from application code
- This means templates can certainly contain logic under the condition
that it is for presentation only. Things such as
[including](./designers/language-builtin-functions/language-function-include.md) other templates,
[alternating](./designers/language-custom-functions/language-function-cycle.md) table row colors,
[upper-casing](./designers/language-modifiers/language-modifier-upper.md) a variable,
[looping](./designers/language-builtin-functions/language-function-foreach.md) over an array of data and
[including](designers/language-builtin-functions/language-function-include.md) other templates,
[alternating](designers/language-custom-functions/language-function-cycle.md) table row colors,
[upper-casing](designers/language-modifiers/language-modifier-upper.md) a variable,
[looping](designers/language-builtin-functions/language-function-foreach.md) over an array of data and
rendering it are examples of presentation logic.
- This does not mean however that Smarty forces a separation of
business and presentation logic. Smarty has no knowledge of which is
Expand Down Expand Up @@ -61,7 +60,7 @@ inheritance, instead of including other templates we maintain our
templates as single pages. We can then manipulate blocks of content
within by inheriting them. This makes templates intuitive, efficient and
easy to manage. See
[Template Inheritance](./programmers/advanced-features/advanced-features-template-inheritance.md)
[Template Inheritance](api/inheritance.md)
for more info.

## Why not use XML/XSLT syntax?
Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started.md
Expand Up @@ -79,6 +79,8 @@ $smarty->setCacheDir('/some/cache/dir');
$smarty->testInstall();
```

## Basic usage

Now, let's create the `index.tpl` file that Smarty will display. This
needs to be located in the [`$template_dir`](./programmers/api-variables/variable-template-dir.md).

Expand Down
6 changes: 3 additions & 3 deletions docs/philosophy.md
Expand Up @@ -13,13 +13,13 @@ newspaper article.

- The article `$headline`, `$tagline`, `$author` and `$body` are
content elements, they contain no information about how they will be
presented. They are [passed](#api.assign) into Smarty by the
presented. They are [passed](getting-started.md#basic-usage) into Smarty by the
application.

- Then the template designer edits the templates and uses a
combination of HTML tags and [template tags](#language.basic.syntax)
combination of HTML tags and [template tags](designers/language-basic-syntax/language-syntax-tags.md)
to format the presentation of these
[variables](#language.syntax.variables) with elements such as
[variables](designers/language-basic-syntax/language-syntax-variables.md) with elements such as
tables, div\'s, background colors, font sizes, style sheets, svg
etc.

Expand Down

0 comments on commit 052fee3

Please sign in to comment.