Я отлично использую cakephp 2.1; Я хочу использовать jquery, чтобы моя форма была разделена на вкладки. Уже использовал jquery вне торта и заработал демо с вкладками. http://jqueryui.com/demos/tabs/
Я также сделал jquery доступным в cakephp из папки webroot и
ProjectsController.php
public $helpers = array('Js' => array('Jquery'));
add.ctp (в самой последней строке)
echo $this->Js->writeBuffer(); // Write cached scripts
Где и как я должен вызывать jquery, на мой взгляд? Я знаю, что должен использовать что-то похожее на демо:
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
Но не знаю, где, на мой взгляд, это сделать и синтаксис.
Кто-нибудь может помочь?
Большое спасибо !
Это если мой полный add.ctp
<div class="projects form">
<?php echo $this->Form->create('Project');?>
<fieldset>
<legend><?php echo __('Add Project'); ?></legend>
<?php
$arr_pr_subject = Configure::read('AR_SUBJECT');
$arr_pr_status = Configure::read('AR_STATUS');
$arr_pr_payment = Configure::read('AR_PAYMENT');
$arr_pr_country = Configure::read('AR_COUNTRY');
echo $this->Form->input('name', array('label' => 'Name:'));
echo $this->Form->input('pr_subject', array('label' => 'Subject:', 'options' => $arr_pr_subject));
echo $this->Form->input('pr_country', array('label' => 'Country:', 'options' => $arr_pr_country));
echo $this->Form->input('pr_number', array('label' => 'ASC Project Number:'));
echo $this->Form->input('pr_status', array('label' => 'Status:', 'options' => $arr_pr_status));
echo $this->Form->input('client_id', array('label' => 'Client:', 'options' => $clients));
echo $this->Form->input('pr_client_number', array('label' => 'Client Project Number:'));
echo $this->Form->input('exec_id', array('label' => 'Sales Executive:', 'options' => $execs));
echo $this->Form->input('pr_start', array('label' => 'Est. Start Date:'));
echo $this->Form->input('pr_end', array('label' => 'Est. End Date:'));
echo $this->Form->input('pr_notes', array('label' => 'Notes:'));
echo $this->Form->input('pr_payment', array('label' => 'Payment options:', 'options' => $arr_pr_payment));
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<?php
echo $this->Js->writeBuffer(); // Write cached scripts
?>