开发者

symfony/propel: problem trying to add a new object action in a backend module

i have created this model:

propel:
  shop_orders:
    orders_id: { phpName: Id, type: INTEGER, size: '11', primaryKey: true, autoIncrement: true, required: true }
    email: { type: VARCHAR, size: '45', required: true }

Then i have generated an admin module and i have add this below to generator.yml:

config:
  actions: ~
  fields:  ~
  list:
    object_actions:
      foo: {}

When I click on the foo action It generates this url:

backend_dev.php/sp1/ListFoo/action?开发者_如何学Goid=1

and I get this message:

Action "sp1/action" does not exist.

sf 1.4/propel

Any idea?

Javier


I have had this same problem with propel 1.5. Tried fixing it by adding routing rules, etc. But what has seemed to work has been simply adding single quotes around the action name in the generator.yml:

list: object_actions: foo: module: foo action: 'Action'


before my answer i got a couple questions myself. What where you trying to do with this:

config:
  actions: ~
  fields:  ~
  list:
    object_actions:
      foo: {}

I think there should be something like:

config:
  actions: ~
  fields:  ~
  list:
    object_actions:
      foo:
        module: foo
        action: action_name

Now, back to your question, the generated link results from a partial located in the generator theme. You can find it at: generator > sfPropelGenerator > theme_name > template > templates > _list_actions.php

there you can find code that looks like:

[....]
<li class="sf_admin_action_<?php echo $params['class_suffix'] ?>">
  <?php echo $this->addCredentialCondition($this->getLinkToAction($name, $params, false), $params)."\n" ?>
</li>
[....]

My guess is that when you defined the new object_action the getLinkToAction received some default values at $params.

Try modifying your generator.yml, clearing cache and check it again.

Good luck!


Peace i have resolve this bug by downloading stable version of symfony and regenerating a new backend at the moment you can do "copy/paste" to upgrade you backend by the old backend Good Luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜