|
 |
|
Yii framework อยากทราบวิธีเพิ่ม comment ใน page ครับ |
|
 |
|
|
 |
 |
|
views/blog/view.php
<?php
/* @var $this BlogController */
/* @var $model Blog */
$this->breadcrumbs=array(
'Blogs'=>array('index'),
$model->title,
);
$this->menu=array(
array('label'=>'List view', 'url'=>array('index')),
array('label'=>'Create Blog', 'url'=>array('create')),
array('label'=>'Update Blog', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Blog', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Blog', 'url'=>array('admin')),
);
?>
<h1>View Blog #<?php echo $model->id; ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'title',
'content',
'created',
'updated',
),
));
?>
views/Comment.php
<?php
/* @var $this CommentController */
/* @var $model Comment */
/* @var $form CActiveForm */
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'comment-Comment-form',
'enableAjaxValidation'=>TRUE,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'name'); ?>
<?php echo $form->textField($model,'name'); ?>
<?php echo $form->error($model,'name'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'email'); ?>
<?php echo $form->textField($model,'email'); ?>
<?php echo $form->error($model,'email'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'article_id'); ?>
<?php echo $form->textField($model,'article_id'); ?>
<?php echo $form->error($model,'article_id'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'comment'); ?>
<?php echo $form->textField($model,'comment'); ?>
<?php echo $form->error($model,'comment'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Submit'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
อยากจะ Import ไปไว้ข้างล่าง ของ Page ครับ ต้องเขียน ยังไงเพิ่งใช้ครั้งแรก -*-
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2013-05-22 16:36:47 |
By :
newbie |
View :
997 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อยากเขียนเป็น อิอิ
|
 |
 |
 |
 |
Date :
2013-05-25 20:33:38 |
By :
อิอิ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|