【问题标题】:Looking For A Good HTML Templater for PHP [closed]为 PHP 寻找一个好的 HTML 模板 [关闭]
【发布时间】:2010-04-15 08:35:52
【问题描述】:

那是 HTML 模板,不是 php 模板,也不是 java 或其他。

我正在寻找类似 HAML for PHP 的东西。我尝试了 PHP、PHAML 和 PHPHaml 的 2 个项目,它们都存在严重的错误。

你知道那里有什么好的 html 模板,最好是 PHP 吗?

编辑我正在寻找可以改变它的东西

<h1>Heading</h1>
<p>entry</p>
<blockquote>quote</blockquote>

这样的事情

h1 : heading
p : entry
blockquote : quote 

类似于phphaml 所做的事情

【问题讨论】:

  • 如果我理解正确,您需要 PHP 模板引擎吗?也许聪明? smarty.net
  • 抱歉,smarty 不适合我 :(

标签: php html haml templating


【解决方案1】:

你为什么不看纺织品?

http://textism.com/tools/textile/

看右边的例子语法,这里有一个例子……

h2{color:green}. This is a title

h3. This is a subhead

p{color:red}. This is some text of dubious character. Isn't the use of "quotes" just lazy writing -- and theft of 'intellectual property' besides? I think the time has come to see a block quote.

转换为:

<h2 style="color:green;">This is a title</h2>

<h3>This is a subhead</h3>

<p style="color:red;">This is some text of dubious character. Isn&#8217;t the use of &#8220;quotes&#8221; just lazy writing&#8212;and theft of &#8216;intellectual property&#8217; besides? I think the time has come to see a block quote.</p>

右侧边栏底部还有其他示例。

【讨论】:

【解决方案2】:

试试http://haml-to-php.com/,它是基于最小解析器引擎的对 phamlp 的完全重写。

【讨论】:

    【解决方案3】:

    你可以使用这个:http://github.com/mo-zag/watcher。有一个关于如何在 Ruby Haml 文件中添加 PHP 代码的指南。该观察者将观察文件并将它们保存到您给定的文件夹中。设置也很简单。您不需要使用任何 PHP 模板解析器,只需使用 Ruby 中的原生 Haml 和 Sass。

    【讨论】:

      猜你喜欢
      • 2011-07-13
      • 2010-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多