本文整理汇总了PHP中sfForm::getJavascripts方法的典型用法代码示例。如果您正苦于以下问题:PHP sfForm::getJavascripts方法的具体用法?PHP sfForm::getJavascripts怎么用?PHP sfForm::getJavascripts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfForm
的用法示例。
在下文中一共展示了sfForm::getJavascripts方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_javascripts_for_form
/**
* Returns <script> tags for all javascripts associated with the given form.
*
* The scripts are set by implementing the getJavaScripts() method in the
* corresponding widget.
*
* <code>
* class MyWidget extends sfWidgetForm
* {
* public function getJavaScripts()
* {
* return array('/path/to/a/file.js');
* }
* }
* </code>
*
* @return string <script> tags
*/
function get_javascripts_for_form(sfForm $form)
{
$html = '';
foreach ($form->getJavascripts() as $file) {
$html .= javascript_include_tag($file);
}
return $html;
}
示例2: use_javascripts_for_form
/**
* Adds javascripts from the supplied form to the response object.
*
* @param sfForm $form
*/
function use_javascripts_for_form(sfForm $form)
{
$response = sfContext::getInstance()->getResponse();
foreach ($form->getJavascripts() as $file) {
$response->addJavascript($file);
}
}
示例3: getJavaScripts
public function getJavaScripts()
{
$javascripts = parent::getJavascripts();
$javascripts[] = '/js/catalogue_people.js';
return $javascripts;
}
示例4: dm_get_javascripts_for_form
/**
* Returns <script> tags for all javascripts associated with the given form.
* @return string <script> tags
*/
function dm_get_javascripts_for_form(sfForm $form)
{
$html = '';
foreach ($form->getJavascripts() as $file) {
$file = sfContext::getInstance()->getResponse()->calculateAssetPath('js', $file);
$html .= javascript_include_tag($file);
}
return $html;
}
示例5: getJavascripts
public function getJavascripts()
{
return array_merge(parent::getJavascripts(), array('student_attendance.js'));
}