English 中文(简体)
动态添加标题如何
原标题:dynamically added title howto

我在使用优秀的菲尔Sturgeon模板库,但我想知道我如何能动地为我的片段的任何部分指定任何标题或标题?就像我有一个带有登录形式的侧边栏。如果登录成功的话,我希望能用Login这样的标题来表示欢迎登录成功而不只创建部分 h2 标记。但作为侧边注意,我注意到模板库的用户指南根本没有提到附件_cs 和附件_js 函数?我在某人的样本代码中看到这个标题,并想知道这是为什么?

感谢大家的支持!

问题回答

您可以在控制器中使用函数 * prepend_ metadata () * 或 * append_ metadata *, 然后在视图中 echo $template[元数据]





相关问题
Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

How to create a submit button template in Oracle APEX?

I m trying to create a template for a button in Oracle APEX but I don t seem to have access to the appropriate substitution strings to make it work. For non-templated buttons APEX seems to insert a ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Load ruby on rails template from database

I wonder if there is a way for me to store ruby on rails view files into database store and have that fetched directly from there. The reason is I want to create a CMS with all the user data stored in ...

Templated HTML Editor

I m looking for a HTML editor that kinda supports templated editing or live snippets or something like that. Background: I m working on a website for a friend. As there are no specifications what the ...

Dreamweaver changing path to site s reference instead of local

I have noticed recently, when I apply a template to a new HTML website, all the relative paths are pointed to my local files, example: file:///C|/webstuff/files but I cannot set them to relative paths ...

WPF ListView : Header styling

I want to have a ListView with columns and a particular style: The background for ALL column headers should be transparent except when the mouse is over in one of them. When this happends, the ...

热门标签