1 %include /usr/lib/rpm/macros.php
3 %define _subclass Template
5 %define _pearname %{_class}_%{_subclass}_Flexy
7 Summary: %{_pearname} - a flexible caching template engine based on SimpleTemplate
8 Summary(pl): %{_pearname} - elastyczny buforuj±cy silnik szablonów oparty na SimpleTemplate
9 Name: php-pear-%{_pearname}
13 Group: Development/Languages/PHP
14 Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
15 # Source0-md5: ac684af4c1f06230f6c261a6bbd2c262
16 Patch0: %{name}-case_fix.patch
17 URL: http://pear.php.net/package/HTML_Template_Flexy/
18 BuildRequires: rpm-php-pearprov >= 4.0.2-98
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 HTML_Template_Flexy started it's life as a simplification of HTML_Template_Xipe,
25 however in Version 0.2, It became one of the first template engine to use a real Lexer,
26 rather than regex'es, making it possible to do things like ASP.net or Cold Fusion tags.
27 However, it still has a very simple set of goals.
30 o prevents to much logic going in templates
31 - Easy to write document'able code
32 o By using object vars for a template rather than 'assign', you
33 can use phpdoc comments to list what variable you use.
34 - Editable in WYSIWYG editors
35 o you can create full featured templates, that doesnt get broken every time you edit with
36 Dreamweaver(tm) or Mozzila editor
37 o Uses namespaced attributes to add looping/conditionals
39 o runtime is at least 4 time smaller than most other template engines (eg. Smarty)
40 o uses compiled templates, as a result it is many times faster on blocks and loops than
41 than Regex templates (eg. IT/phplib)
42 - Safer (for cross site scripting attacks)
43 o All variables default to be output as HTML escaped (overridden with the :h modifier)
44 - Multilanguage support
45 o Parses strings out of template, so you can build translation tools
46 o Compiles language specific templates (so translation is only done once, not on every request)
47 - Full dynamic element support (like ASP.NET), so you can pick elements to replace at runtime
50 - {variable} to echo $object->variable
51 - {method()} to echo $object->method();
52 - {foreach:var,key,value} to PHP foreach loops
53 - tag attributes FLEXY:FOREACH, FLEXY:IF for looping and conditional HTML inclusion
54 - {if:variable} to PHP If statement
55 - {if:method()} to PHP If statement
56 - {else:} and {end:} to close or alternate If statements
57 - FORM to HTML_Template_Flexy_Element's
58 - replacement of INPUT, TEXTAREA and SELECT tags with HTML_Template_Flexy_Element code
59 use FLEXY:IGNORE (inherited) and FLEXY:IGNOREONLY (single) to prevent replacements
60 - FLEXY:START/FLEXY:STARTCHILDREN tags to define where template starts/finishes
61 - support for urlencoded braces {} in HTML attributes.
62 - documentation in the pear manual
64 - examples at http://cvs.php.net/cvs.php/pear/HTML_Template_Flexy/tests/
66 The long term plan for Flexy is to be integrated as a backend for the Future
67 Template Package (A BC wrapper will be made available - as I need to use it
70 In PEAR status of this package is: %{_status}.
73 Flexy Template to silnik szablonów do konwertera kodu PHP, oparty na
74 Simple Template i podobny do Smarty. Powinien byæ bardzo szybki, jest
75 ³atwy w rozszerzaniu, rozwijaniu i u¿ywaniu dowolnej sk³adni
76 szablonów. Domy¶lny filtr (SimpleTags) zawiera: zmienne, pêtle
77 foreach, warunki, wywo³ania metod, w³±czanie kodu, obs³uguje znaczniki
78 zakodowane w URL-ach - wiêc mo¿e modyfikowaæ szablony w Mozilli itp.
80 - RtfSimpletags - do tworzenia dokumentów RTF dla Worda,
81 - BodyOnly - wycinaj±cy nag³ówek i stopkê z szablonu,
82 - Php - wycinaj±cy kod php z szablonu,
83 - Email - do przetwarzania szablonów e-mail.
85 Ta klasa ma w PEAR status: %{_status}.
89 cd %{_pearname}-%{version}
93 rm -rf $RPM_BUILD_ROOT
94 install -d $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/{Compiler/{Flexy,Standard,Regex},Token}
96 install %{_pearname}-%{version}/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}
97 install %{_pearname}-%{version}/Flexy/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy
98 install %{_pearname}-%{version}/Flexy/Compiler/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler
99 install %{_pearname}-%{version}/Flexy/Compiler/Flexy/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Flexy
100 install %{_pearname}-%{version}/Flexy/Compiler/Standard/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Standard
101 install %{_pearname}-%{version}/Flexy/Compiler/Regex/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Compiler/Regex
102 install %{_pearname}-%{version}/Flexy/Token/*.php $RPM_BUILD_ROOT%{php_pear_dir}/%{_class}/%{_subclass}/Flexy/Token
105 rm -rf $RPM_BUILD_ROOT
108 %defattr(644,root,root,755)
109 %doc %{_pearname}-%{version}/{Flexy/example.ini,tests}
110 %{php_pear_dir}/%{_class}/%{_subclass}/Flexy
111 %{php_pear_dir}/%{_class}/%{_subclass}/Flexy.php