Re: [PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Anton Andrievskij
Patrick, are you developer of PHPTAL or not?

Anton

On Fri, May 30, 2008 at 5:29 PM, Patrick Burke [EMAIL PROTECTED] wrote:

 I love PHPTAL, and the self documentation thread going on is a very
 interesting idea.  The requirement that brought up self-documentation
 seems like a development environment issue though,  The development
 environment issue seems odd to me because I would think that the core
 variables needed would be made available by Development.  If Design
 needs some variables that Devel needs to know about then a simple
 intermediate layer would let Design do their own
 $template_obj-set('thevar', thevalue);  But if the code is nicely
 segmented then some designated member of Design should be able to add
 to the PHP code that is loading the template directly (ideally, anyone
 on Design if the code is locked down and versioned).

 I'm not poo-poo'ing the self-documentation idea, I'm just sick of
 Smarty and I know PHPTAL can become the de facto PHP standard if
 development of PHPTAL, in the short term, were geared more towards
 marketing bullet points that can be proudly displayed on a big, pretty
 banner on a web page.  So I'd like to see some awesome effort (yes,
 I'm talking to myself as well) towards things like memcached
 integration, Eclipse/editor plugins, get rally slick with the
 trigger and format systems, and even a geeky effort to do an extended
 promotional push (yes, I'm mentioning a project that doesn't
 necessarily involve coding) because, admit it, PHPTAL was there at
 1.18 so it's ready to get a little promotion and that means people
 coordinating a push.

 I'm seeing PHPTAL at a tipping point.  I wasn't able to get PHPTAL
 into many environments in the last couple years because big, fat, ugly
 Smarty was sitting in the templates directories already.  PHPTAL has
 awesome core features, is better than fast enough, and has a great
 lookin' future so it's not hard to pitch it when I can get a chance to
 list off the coolness of it.  I, and others, will get more of a chance
 to pitch it if there were just a few more..I hate to say this
 but..enterprise features that make it more known about to higher
 level Development leads.  It's true though.

 Hew

 On Fri, May 30, 2008 at 6:00 AM,  [EMAIL PROTECTED]
 wrote:
  Send PHPTAL mailing list submissions to
 phptal@lists.motion-twin.com
 
  To subscribe or unsubscribe via the World Wide Web, visit
 http://lists.motion-twin.com/mailman/listinfo/phptal
  or, via email, send a message with subject or body 'help' to
 [EMAIL PROTECTED]
 
  You can reach the person managing the list at
 [EMAIL PROTECTED]
 
  When replying, please edit your Subject line so it is more specific
  than Re: Contents of PHPTAL digest...
 
 
  Today's Topics:
 
1. Re: automated documentation for templates? (Kornel Lesinski)
 
 
  --
 
  Message: 1
  Date: Fri, 30 May 2008 10:32:04 +0100
  From: Kornel Lesinski [EMAIL PROTECTED]
  Subject: Re: [PHPTAL] automated documentation for templates?
  To: Template Attribute Language for PHP
 phptal@lists.motion-twin.com
  Message-ID: [EMAIL PROTECTED]
  Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
 
  On Fri, 30 May 2008 10:19:18 +0100, Iván -DrSlump- Montes
  [EMAIL PROTECTED] wrote:
 
  With something like this the comment won't show up
 
  tal:comment tal:replace=null!--
Comment: Here is a comment which won't show up in the generated HTML
  --/tal:comment
 
  any element can have tal:comment attribute.
 
  li tal:comment=won't be in HTML /
 
  and it's possible to register your own attribute or namespace in PHPTAL,
  so you could have
 
  li my:documentation=... /
 
  --
  regards, Kornel
 
 
 
  --
 
  ___
  PHPTAL mailing list
  PHPTAL@lists.motion-twin.com
  http://lists.motion-twin.com/mailman/listinfo/phptal
 
 
  End of PHPTAL Digest, Vol 39, Issue 13
  **
 

 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
Hi, guys.

How can I specify multiple conditions using AND logical operator and php:
for one of the parts?

I'm trying this but does not works:

tal:condition=exists: products AND php:count(products) == 0

Thanks,
Anton
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Re: developer of PHPTAL or not

2008-05-30 Thread Anton Andrievskij
I agree about 'marketing friendly' too.

PHPTAL guys, lets improve on this part. I'll help doing my best for this
task.

Anton

On Fri, May 30, 2008 at 7:28 PM, Iván -DrSlump- Montes 
[EMAIL PROTECTED] wrote:

 I've been trying to push for PHPTAL use in several projects in the
 last years but I haven't been very successful. I ended up writing my
 own version from scratch a couple of months ago, leveraging new PHP
 5.3 features and the bundled XML parsers + Tidy for legacy templates.

 The main point in implementing my own version was to make it extremely
 modular to support custom storage (file, string, pdo...), easily
 extendable namespaces, tales modifiers, pre/post filters and code
 generation in other languages besides PHP (Javascript). While PHPTAL
 supports most of that stuff it's showing its age and doesn't makes use
 of modern PHP's OO features. That's why I target 5.3, so I can tell
 management that the library is using 'latests technology' and is
 easily hookable into existing frameworks like ZF or Symfony. Using a
 BSD like license was also required in some projects.

 As for integration with IDEs, being an XML format I guess the only
 thing needed is to implement a DTD and a RelaxNG schema to cover most
 editors.

 I also agree on that it needs to be more 'marketting friendly', the
 home page is an invaluable resource given that the manual is quite
 complete but it does not sale the product. And a section with tips and
 tricks (zebra rows, working with javascript, ...) would also help a
 lot newcomers.

 Iván

 On Fri, May 30, 2008 at 5:33 PM, Patrick Burke [EMAIL PROTECTED] wrote:
  Anton, yes I am a developer of PHPTAL but I'm not on the PHTPAL
  developer list.  My modifications have been specific to the company I
  was implementing it for but I've made more general modifications along
  the way, like some memcached/compiled templates trickery I used at the
  last place I did a gig for, and I'm ready to make a formal
  contribution so the PHPTAL Developers can tell me what's up/what they
  think.  But even if my own contributions get shot down I'd like to see
  development of PHPTAL geared towards the people I have to pitch to:
  CTOs, IT Managers, Directors/Producers of Internet Programming, etc.
  Just for a while anyways, just until there's undeniable awareness of
  PHPTAL in that segment of IT personnel.  I think it's only a matter of
  adding and promoting a few more enterprise features to the project
  (I really, rally hate that enterprise term but...you probably
  know what I mean when I say it so that's why I'm using it).
 
  I've probably got another couple of months before I get up to speed on
  the latest version of PHPTAL and then implement the memcached thingy I
  did.  Hopefully I'm an official PHPTAL developer at that point.
 
  But do you get what I'm saying about the direction of development in
  the short term?  It's just that I know too many CTO types that have
  actually heard of Smarty but are baffled by this new-fangled PHPTAL
  stuff, and they aren't even keen on hearing about it until I start
  sneaking in comments like, See, that problem just simply doesn't ever
  happen when you use PHPTAL, or We wouldn't worry about that
  bottleneck if we had something like PHPTAL's system.
 
  Know what I mean?
 
  Hew
 

 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Multiple conditions

2008-05-30 Thread Anton Andrievskij
 PHPTAL rewrites code in php: expressions to use TAL variables, so it
will work fine.

Please can you explain a bit more about this? How it works?

On Fri, May 30, 2008 at 7:47 PM, Kornel Lesinski [EMAIL PROTECTED]
wrote:

 On Fri, 30 May 2008 17:36:34 +0100, Anton Andrievskij [EMAIL PROTECTED]
 wrote:

  1. But then php will check if real products variable exists but not
 tal-object's product property?


 PHPTAL rewrites code in php: expressions to use TAL variables, so it will
 work fine.

 php:isset(var) is equivalent to exists:var (but not in more complex case of
 exists:var/prop - then you're out of luck ;)

  2. Why it is bad idea to have some logical operands in PHPTAL then?


 It isn't. It's a bit of syntax that's missing from plain TAL.


 --
 regards, Kornel

 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Re: PHPTAL Digest, Vol 39, Issue 13

2008-05-30 Thread Anton Andrievskij
I think it is better to get new developers with new programming logic to use
PHPTAL. Then you will have more strong and professional community. Smarty
must go to the syncope together with its old-type programmers.

As for me - I never used Smarty because I found it ugly and stupid the first
time I opened their features list.

Anton

On Fri, May 30, 2008 at 7:54 PM, Kornel Lesinski [EMAIL PROTECTED]
wrote:

 On Fri, 30 May 2008 15:29:10 +0100, Patrick Burke [EMAIL PROTECTED]
 wrote:

  I'm seeing PHPTAL at a tipping point.  I wasn't able to get PHPTAL
 into many environments in the last couple years because big, fat, ugly
 Smarty was sitting in the templates directories already.


 Perhaps writing Smarty → PHPTAL converter would help here? (this is
 challenging project as it requires figuring out what all kinds of crazy
 smarty-html mixes are supposed to do, e.g. {if}s around attributes).

 --
 regards, Kornel

 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Error with LINK tag

2008-05-22 Thread Anton Andrievskij
Hi.

I'm trying to build RSS using PHPTAL. I just noticed about very strange
problem...

link tal:content=item/link
http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp/link
produces link /

This does not work exactly with LINK tag. If I cahgne link to linkItem -
it works.

Anton
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Error with LINK tag

2008-05-22 Thread Anton Andrievskij
Thanks for this help. I'm realising both RSS and ATOM, sure.

Anton

On Thu, May 22, 2008 at 12:44 PM, Kornel Lesinski 
[EMAIL PROTECTED] wrote:

 On 22 May 2008, at 07:34, Anton Andrievskij wrote:

  I'm trying to build RSS using PHPTAL. I just noticed about very strange
 problem...

 link tal:content=item/linkhttp://liftoff.msfc.nasa.gov/news/
 2003/news-starcity.asp/link
 produces link /

 This does not work exactly with LINK tag. If I cahgne link to linkItem -
 it works.


 By default PHPTAL works in XHTML mode which follows suggestions in Appendix
 C of XHTML specification (one of which is using self-closing tags for
 link/, meta/, img/).

 To disable this, switch PHPTAL to pure XML behaviour:

 $phptal-setOutputMode(PHPTAL::XML);


 BTW: Atom feed format is much better :)

 --
 regards, Kornel


 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Using PHPTAL with index.php?page=... thing

2008-01-21 Thread Anton Andrievskij
Hi, PHPTAL users.

(Sorry for my bad English as I'm from Ukraine)

I write this letter to ask about what the best idea about how to use the
PHPTAL engine with
the standard PHP site engine technology like this:

www.mysite.com/index.php?page=login
www.mysite.com/index.php?page=faq
www.mysite.com/index.php?page=subscrib
and so on...

I'm going to build index.html template and run it from index.php page, but
then
I have different code to be executed on different pages like login.php,
faq.php, subscribe.php and so on.

So I have to have index.html, login.html, faq.html and
subscrib.htmltemplates, but also
I want to have index.php, faq.php, subscrib.php pages with some code to be
executed.

How can I join such things together?

I'm really waiting for any answer or advice and any comments may help.

Thanks in advance,
Anton Andriyevskyy
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] JavaScript arrays using PHPTAL

2008-01-21 Thread Anton Andrievskij
Ok, so the idea is to build data in the PHP, then simply past it to the
script using tal:content. Thanks.

On Jan 21, 2008 1:08 PM, Christoph Frick [EMAIL PROTECTED] wrote:

 On Mon, Jan 21, 2008 at 12:43:21PM +0200, Anton Andrievskij wrote:

  I have to fill JavaScript array using PHPTAL attributes.
 
  Whether I can use some span ...tal-attributes here../span inside
  script/script construction?
 
  Example:
 
  script language=JavaScript
 items = array(
 span ..PHPTAL loop here...
 span tal:replace ...writing item values to fill JavaScript
  array.../span
 /span
 )
  /script
 
 
  If I can't do so, have you any idea about how to do it?

 you can do so. but IE can not cope with trailing ``,``; so you have to
 add something like:

  span tal:condition=not:repeat/item/end, /span

 and beside that: why not write method, that returns the data directly?
 or a phptal_tales_something formatter?

 --
 cu

 ___
 PHPTAL mailing list
 PHPTAL@lists.motion-twin.com
 http://lists.motion-twin.com/mailman/listinfo/phptal


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Using PHPTAL with index.php?page=... thing

2008-01-21 Thread Anton Andrievskij
Thanks, I'll read.

Anton

On Jan 21, 2008 1:39 PM, Levi Stanley [EMAIL PROTECTED] wrote:

 I ithink you might be looking for something like this:

 http://www.phpmvc.net/docs/guides/guidesIdx.php?doc=adv-pg-layout-tal


 On Jan 21, 2008 6:32 AM, Anton Andrievskij [EMAIL PROTECTED] wrote:

  Ok, you told the same thing but in shortest and more simple words.
  Thanks you.
 
  PHPTAL works best if you design your application using MVC pattern
  Where can I read professional comments and how it works?
 
  Thanks,
  Anton
 
 
  On Jan 21, 2008 1:30 PM, Anton Andrievskij [EMAIL PROTECTED]  wrote:
 
   Ok, I found some idea about how to solve my problem.
   The method is very easy and applicable to use both PHPTAL and PHP CMS
   engine technology
   described in my first letter (which is question).
  
   The idea is to have only one index.html template with the site layout,
   and then to have different
   login.html, faq.html, subscribe.html (and so on) layouts to insert
   into index.html layout.
   Take into account that I do not want to rewrite site layout in all
   templates, I want to have it only in index.html.
  
   So I build index.html, and then I build some library with macroses for
   each page. I'm planning to use them then
   using metal:use-macro attribute.
  
   So the steps are:
  
  
  1. Create index.html template for page layout (navigation, news
  and so on) and templates for each page using metal:define-macro for 
   each
  page
  2. Create $template = new PHPTAL(index.html) in your index.phpfile 
   and define variables in $template to use to render site's layout
  3. Define something like $template-page and use it in
  metal:use-macro tag to insert specific page content
  4. Create faq.php, login.php and other files so you will add
  specific $template-pagespecificvariable1,  
   $template-pagespecificvariable2
  (...) values
  5. Use specific variable values in specific macroses.
  6. In index.php include specific pageX.php (index.php?page=pageX).
  So your pageX will add specific variable values to the $template
  7. Render page using $template object
  
  
   Any comments may help to improve the idea.
  
   Anton
  
  
   On Jan 21, 2008 1:07 PM, Levi Stanley  [EMAIL PROTECTED]  wrote:
  
   
   
Actually, phptal should only be used for the presentation of the
 data.

 your controller and models, should do most of the work you want.

 Here is a snippet of my index.php aka navigation controller:

 *...
 *if (isset($__xml_attributes['redirect'])){
 print header(Location:
 {$__xml_attributes['redirect']});
 exit;
 } else if (isset($__xml_attributes['execute'])) {

 $benchmark-start('loading-sub-controller-section');

 include_once(controllers/{$__xml_attributes['execute']}.php);

 $benchmark-stop('loading-sub-controller-section');
 }
 *...

 *Nevermind the benchmark stuff, I like to know how long everything
 takes to run.


 On Jan 21, 2008 5:27 AM, Anton Andrievskij  [EMAIL PROTECTED]
 wrote:

  Thanks you; I got your idea, but it seems that I can't execute
  PHP scripts from templates using PHPTAL (?)
 
  Anton
 
 
  On Jan 21, 2008 12:13 PM, Levi Stanley  [EMAIL PROTECTED]
  wrote:
 
   Sorry, forgot to change the email, I was sending this from.
  
   Read below:
  
   -- Forwarded message --
   Date: Jan 21, 2008 5:08 AM
   Subject: Re: [PHPTAL] Using PHPTAL with index.php?page=...
   thing
   To: Template Attribute Language for PHP 
   phptal@lists.motion-twin.com
  
  
   Hmm, kind of sounds like the system I built.  I have a
   site-controller.xml file:
  
   site-controller
   *...*
   warning-page use-page=warning-page.xhtml
   execute=display-page record-page=true /
   send-to template-id=1
   page alias=main-page use-page=
   main-page.xhtml execute=main-page record-page=true /
   page alias=join-page use-layout=
   join-page.xhtml execute=join-page record-page=true
   *...*
   /send-to
   /site-controller
  
   My system, I can have multiple templates, identified by the
   template-id, use-page, and use-layout, this just tell me what 
   page view to
   use, and the execute attribute tells me what php file to execute,
   display-page is a generic display script.  The record-page 
   attribute,
   defines if I should record traffic information for that page or 
   not.
  
   My directory structure looks like this:
  
   /www/sites/mysite.com/application--
   usually the controller resides here index.php
   /www/sites/mysite.com/application/controllers