| 1 | package Strehler::FormFu::Element::Slug; | ||
| 2 | 4 | $Strehler::FormFu::Element::Slug::VERSION = '1.6.8'; | |
| 3 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | extends 'HTML::FormFu::Element::Label'; | |
| 7 | |||
| 8 | 28 | ▶ | after BUILD => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 9 | 28 | my $self = shift; | |
| 10 | 28 | $self->name("slug"); | |
| 11 | 28 | $self->label("Slug [Automatic]"); | |
| 12 | 28 | $self->default("..."); | |
| 13 | 28 | $self->attributes({'class' => 'span8 slug'}); | |
| 14 | 28 | return; | |
| 15 | 4 | }; | |
| 16 | |||
| 17 | =encoding utf8 | ||
| 18 | |||
| 19 | =head1 NAME | ||
| 20 | |||
| 21 | Strehler::FormFu::Element::Slug - FormFu Element for Strehler slug field. | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | A formfu field to show slug in slugged entities. It's a read-only field because slug is automatically managed. | ||
| 26 | |||
| 27 | =head1 SYNOPSIS | ||
| 28 | |||
| 29 | In article form: | ||
| 30 | |||
| 31 | - type: "+Strehler::FormFu::Element::Slug" | ||
| 32 | |||
| 33 | No parameters, no labels. | ||
| 34 | |||
| 35 | =head1 GENERATED HTML | ||
| 36 | |||
| 37 | <div> | ||
| 38 | <label>Slug [Automatic]</label> | ||
| 39 | <span name="slug" class="span8 slug">99-lorem-ipsum</span> | ||
| 40 | </div> | ||
| 41 | |||
| 42 | =head1 YAML CONFIGURATION | ||
| 43 | |||
| 44 | - name: slug | ||
| 45 | label: "Slug [Automatic]" | ||
| 46 | type: label | ||
| 47 | attributes: | ||
| 48 | class: "span8 slug" | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | 4 | 1; | |