0
Joomlaコンポーネントを新しく開発しました。 My JoomlaコンポーネントにTime Pickerを追加する方法を知りたいJoomla Compoentで時間ピッカーを使用する方法
Joomlaコンポーネントを新しく開発しました。 My JoomlaコンポーネントにTime Pickerを追加する方法を知りたいJoomla Compoentで時間ピッカーを使用する方法
Joomlaで独自のカスタムフィールドタイプを作成できます。この例では、モジュールのためですが、同じプロセスは、コンポーネントと連携して動作します。 /modules/mod_yourmodule/fields/datetime.php
<?php // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Add CSS and JS JHtml::stylesheet('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css'); JHtml::stylesheet('http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css');JHtml::script('http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js'); jimport('joomla.form.formfield'); class JFormFieldDateTime extends JFormField {
protected $type = 'DateTime';
public function getInput() {
return '<div class="well">'.
'<div id="datetimepicker2" class="input-append">'.
'<input data-format="MM/dd/yyyy HH:mm:ss PP" type="text"></input>'.
'<span class="add-on">'.
'<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>'.
'</span>'.
'</div>'.
'</div>'.
'<script type="text/javascript">'.
'jQuery(function() {'.
'jQuery("#datetimepicker2").datetimepicker({'.
'language: "en",'.
'pick12HourFormat: true'.
'});'.
'});'.
'</script>';
} }
表示カレンダーコントロールフィールド:
calendar($value, $name, $id, $format= '%Y-%m-%d', $attribs=null)
$value=>The date value,$name=>The name of the text field,$id=>The id of the text field,$format=>'%Y-%m-%d' The date format,$attribs=>null Additional html attributes,$value=>The date value,$name=> The name of the text field,$id=> The id of the text field,$format=>'%Y-%m-%d' The date format,$attribs=>null Additional html attributes
なぜ輸入**他**インスタンスのこのファイルを作成します ブートストラップ?また、コードの半分がコメントアウトされているので、コードを適切に表示することもできます。 – Lodder