Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| slam4:php:phalcon:viewhelpers [2015/10/01 23:50] – modification externe 127.0.0.1 | slam4:php:phalcon:viewhelpers [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== View Helpers ====== | ====== View Helpers ====== | ||
| - | La classe [[http://docs.phalconphp.com/ | + | La classe [[https://api.phalconphp.com/ |
| + | Elle est définie en tant que service et est accessible depuis les vues et les controlleurs. | ||
| ===== -- Doctype ===== | ===== -- Doctype ===== | ||
| Ligne 19: | Ligne 20: | ||
| <sxh php; | <sxh php; | ||
| <?php echo $this-> | <?php echo $this-> | ||
| + | </ | ||
| + | |||
| + | <sxh html; | ||
| + | {{ get_doctype() }} | ||
| </ | </ | ||
| Ligne 46: | Ligne 51: | ||
| ===== -- Création de formulaires ===== | ===== -- Création de formulaires ===== | ||
| - | ===== -- Eléments de formulaires ===== | + | ==== phtml ==== |
| - | ===== -- Modification des attributs des éléments ===== | + | <sxh php> |
| + | <?php | ||
| + | $this-> | ||
| + | $this->tag-> | ||
| + | </ | ||
| + | ==== volt ==== | ||
| + | |||
| + | <sxh html> | ||
| + | {{ form(" | ||
| + | {{end_form()}} | ||
| + | </ | ||
| + | ===== -- Éléments de formulaires ===== | ||
| + | |||
| + | ==== phtml ==== | ||
| + | |||
| + | <sxh php> | ||
| + | <? | ||
| + | echo $this-> | ||
| + | |||
| + | echo $this-> | ||
| + | " | ||
| + | "This is the content of the text-area", | ||
| + | " | ||
| + | " | ||
| + | )); | ||
| + | |||
| + | echo $this-> | ||
| + | " | ||
| + | " | ||
| + | )); | ||
| + | |||
| + | echo $this-> | ||
| + | " | ||
| + | " | ||
| + | )); | ||
| + | </ | ||
| + | |||
| + | ==== volt ==== | ||
| + | |||
| + | <sxh html> | ||
| + | {{ text_field(" | ||
| + | |||
| + | {{ text_area(" | ||
| + | |||
| + | {{ password_field(" | ||
| + | |||
| + | {{ hidden_field(" | ||
| + | </ | ||
| + | ===== -- Modification des valeurs des éléments ===== | ||
| + | |||
| + | Les éléments de formulaire possédant un attribut **value** peuvent être affectés à la création : | ||
| + | |||
| + | ==== phtml ==== | ||
| + | |||
| + | <sxh php> | ||
| + | <? | ||
| + | echo $this-> | ||
| + | echo $this-> | ||
| + | " | ||
| + | "This is the content of the text-area", | ||
| + | " | ||
| + | " | ||
| + | )) ?> | ||
| + | </ | ||
| + | |||
| + | ==== volt ==== | ||
| + | |||
| + | <sxh html> | ||
| + | {{ text_field(" | ||
| + | |||
| + | {{ text_area(" | ||
| + | </ | ||
| + | |||
| + | Il est également possible, préférable (pour l' | ||
| + | |||
| + | |||
| + | <sxh php; | ||
| + | class ProductsController extends Controller | ||
| + | { | ||
| + | public function indexAction() | ||
| + | { | ||
| + | $this-> | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| ===== -- Contenus statiques ===== | ===== -- Contenus statiques ===== | ||
| + | ==== Feuilles de style ==== | ||
| + | === phtml === | ||
| + | <sxh php> | ||
| + | <?php | ||
| + | echo Phalcon\Tag:: | ||
| + | echo Phalcon\Tag:: | ||
| + | </ | ||
| + | === volt === | ||
| + | <sxh html> | ||
| + | {{ stylesheet_link(" | ||
| + | {{ stylesheet_link(" | ||
| + | </ | ||
| + | |||
| + | ==== javascript file ==== | ||
| + | === phtml === | ||
| + | |||
| + | <sxh php> | ||
| + | <?php | ||
| + | |||
| + | echo Phalcon\Tag:: | ||
| + | echo Phalcon\Tag:: | ||
| + | </ | ||
| + | |||
| + | |||
| + | === volt === | ||
| + | <sxh html> | ||
| + | {{ javascript_include(" | ||
| + | {{ javascript_include(" | ||
| + | </ | ||
| + | |||
| + | ==== Images ==== | ||
| + | |||
| + | === phtml === | ||
| + | |||
| + | <sxh php> | ||
| + | <?php | ||
| + | |||
| + | echo Phalcon\Tag:: | ||
| + | echo Phalcon\Tag:: | ||
| + | </ | ||
| + | |||
| + | === volt === | ||
| + | |||
| + | <sxh html> | ||
| + | |||
| + | {{ image(" | ||
| + | {{ image(" | ||
| + | {{ image(" | ||
| + | </ | ||