Cakephp croogo的简单博客

Cakephp croogo的简单博客,cakephp,croogo,Cakephp,Croogo,我不是什么问题,我在Croogo做了一个简单的博客,问题是它没有添加、修改或删除,因为阿拉伯语 function add in controller `public function admin_add() { $this->set('title_for_layout', __('Add Part')); if (!empty($this->request->data)) { $this->Part->crea

我不是什么问题,我在Croogo做了一个简单的博客,问题是它没有添加、修改或删除,因为阿拉伯语

function add in controller
`public function admin_add() {
        $this->set('title_for_layout', __('Add Part'));
        if (!empty($this->request->data)) {
            $this->Part->create();

            if ($this->Part->save($this->request->data)) {
                $this->Session->setFlash(__('The Part has been saved'), 'default', array('class' => 'success'));
                $this->redirect(array('action' => 'index'));//, $this->Part->id));
            } else {
                $this->Session->setFlash(__('The Part could not be saved. Please, try again.'), 'default', array('class' => 'error'));
            }
        }
    }`
=> 模型

` 添加视图



消息错误:在此服务器上找不到请求的地址。

我认为这不是因为阿拉伯语,因为当您这样做时:

        echo $this->Form->label('prop_Pledge', 'إقتراح التعهد :  ');
第二个参数是文本。我不知道您使用的是哪一个Cake版本,但我认为第一个字段应该是Part.prop_质押(Cake v3)

我建议您尝试使用debug()和exit来查看真正的问题在哪里,或者尝试使用remove阿拉伯语字符来查看这是否是问题的原因

  • 只是一个问题,您的$this->Form->create()在视图中的什么位置

行已成功添加到数据库,但未返回到索引 它会显示一条错误消息

你能把错误信息打印出来吗


希望这将对您有所帮助。

行已成功添加到数据库中,但不会返回索引。它将显示一条错误消息
    <?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Part');?>
<fieldset>
    <div class="tabs">
        <ul>
            <li><a href="#role-main"><span><?php echo __('Part'); ?></span></a></li>
            <?php echo $this->Layout->adminTabs(); ?>
        </ul>

        <div id="role-main">
        <?php
            echo $this->Form->label('num_part', 'العدد :  '); 
            echo $this->Form->input('num_part',array('label' => false ));

            echo $this->Form->label('prix_part', 'االمبلغ :  ');
            echo $this->Form->input('prix_part',array('label' => false ));

            echo $this->Form->label('prop_Pledge', 'إقتراح التعهد :  ');
            echo $this->Form->input('prop_Pledge',array('label' => false ));

            echo $this->Form->label('prix_Pledge', 'مبلغ التعهد :  ');
            echo $this->Form->input('prix_Pledge',array('label' => false ));
        ?>
        </div>
        <?php echo $this->Layout->adminTabs(); ?>
    </div>
</fieldset>

<div class="buttons">
<?php
    echo $this->Form->end(__('Save'));
    echo $this->Html->link(__('Cancel'), array(
        'action' => 'index',
    ), array(
        'class' => 'cancel',
    ));

?>
</div>
        echo $this->Form->label('prop_Pledge', 'إقتراح التعهد :  ');