The essence of the problem is as follows. I have a project on symfony 2.3 which uses the symfony2admingenerator gang . This module is responsible for building logs and actions with them.

The problem is that I can’t properly set up a non-standard route for a specific action. The route itself has the following format: @Route("/{id}/equipment-bind", name="Nitra_OutletBundle_BindPosEquipment")

The logs are described in the yml format. Below is a complete description of the directory.

 generator: admingenerator.generator.doctrine params: model: Nitra\SchemaCDBBundle\Entity\POS namespace_prefix: Nitra bundle_name: OutletBundle fields: id: dbType: string label: fields.pos.id custId: label: fields.pos.custId kodPos: label: fields.pos.kodPos name: label: fields.pos.name address: label: fields.pos.address legalName: label: fields.pos.legalName legalAddress: label: fields.pos.legalAddress latitude: label: fields.pos.latitude longitude: label: fields.pos.longitude timeWorkFrom: label: fields.pos.timeWorkFrom timeWorkTo: label: fields.pos.timeWorkTo timeBreakFrom: label: fields.pos.timeBreakFrom timeBreakTo: label: fields.pos.timeBreakTo phone: label: fields.pos.phone fax: label: fields.pos.fax edrpou: label: fields.pos.edrpou description: label: fields.pos.description numberOfCells: label: fields.pos.numberOfCells lengthShelf: label: fields.pos.lengthShelf salesSquare: label: fields.pos.salesSquare whSquare: label: fields.pos.whSquare bStandart: label: fields.pos.bStandart daysOfCredit: label: fields.pos.daysOfCredit filial: label: fields.pos.filial sort_on: filial.translations.name posType: label: fields.pos.posType addFormOptions: group_by: posTypeGroup.name sort_on: posType.translations.name posStatus: label: fields.pos.posStatus sort_on: posStatus.translations.name network: label: fields.pos.network formType: select2_entity addFormOptions: group_by: networkType.name configs: placeholder: '' sort_on: network.translations.name settlement: label: fields.pos.settlement sort_on: settlement.translations.name employee: label: fields.pos.employee formType: select2_entity sort_on: employee.sureName addFormOptions: property: formName configs: placeholder: '' decisionMakers: label: fields.pos.decisionMakers visits: label: fields.pos.visits routeDetails: label: fields.pos.routeDetails tasks: label: fields.pos.tasks morningMeetingDetails: label: fields.pos.morningMeetingDetails equipmentHeads: label: fields.pos.equipmentHeads debtHeads: label: fields.pos.debtHeads paymentHeads: label: fields.pos.paymentHeads saleHeads: label: fields.pos.saleHeads rtiKey: label: fields.pos.rtiKey priceHeads: label: fields.pos.priceHeads leftovers: label: fields.pos.leftovers supervizor: label: fields.pos.supervizor getter: Employee.parent distributor: label: fields.pos.distributor getter: filial.distributor dbType: string createdAt: label: fields.pos.createdAt updatedAt: label: fields.pos.updatedAt parent: label: fields.pos.supervizor dbType: string formType: text object_actions: delete: credentials: 'hasRole("ROLE_ADMIN") or(hasRole("ROLE_SUPER_ADMIN") or hasRole("ROLE_POS_EDIT"))' info: label: action.object.posInfo editEquipment: label: action.object.editEquipment builders: list: params: max_per_page: 100 title: list.title.pos display: [ custId, rtiKey, name, address, settlement, employee, network, posType, posStatus ] actions: new: ~ object_actions: info: ~ edit: ~ editEquipment: route: Nitra_OutletBundle_BindPosEquipment params: id: id filters: params: display: [ custId, name, address, settlement, posType, rtiKey, network, posStatus, parent, employee, filial ] new: params: credentials: 'hasRole("ROLE_ADMIN") or(hasRole("ROLE_SUPER_ADMIN") or hasRole("ROLE_POS_NEW"))' fields: id: addFormOptions: attr: readonly: true custId: addFormOptions: attr: readonly: true rtiKey: addFormOptions: attr: readonly: true title: new.title.pos|{ POS.Name }| display: "tab.pos.general": [ rtiKey, id, custId, employee, posStatus ] "tab.pos.additional": [ name, address, posType, network ] "tab.pos.address": [ settlement, latitude, longitude ] "tab.pos.legal": [ legalName, edrpou, legalAddress ] "tab.pos.size": [ timeWorkFrom, timeWorkTo, timeBreakFrom, timeBreakTo, numberOfCells, lengthShelf, salesSquare, whSquare, bStandart ] "tab.pos.contacts": [] "tab.pos.route_map": [] "tab.pos.order": [] "tab.pos.payment": [] actions: save: ~ list: ~ save-and-list: ~ new: params: credentials: 'hasRole("ROLE_ADMIN") or(hasRole("ROLE_SUPER_ADMIN") or hasRole("ROLE_POS_NEW"))' title: edit.title.pos|{ POS.Name }| actions: save: ~ list: ~ save-and-list: ~ edit: params: credentials: 'hasRole("ROLE_ADMIN") or(hasRole("ROLE_SUPER_ADMIN") or hasRole("ROLE_POS_EDIT"))' fields: id: addFormOptions: attr: readonly: true custId: addFormOptions: attr: readonly: true rtiKey: addFormOptions: attr: readonly: true title: edit.title.pos|{ POS.Name }| display: "tab.pos.general": [ rtiKey, id, custId, employee, posStatus ] "tab.pos.additional": [ name, address, posType, network ] "tab.pos.address": [ settlement, latitude, longitude ] "tab.pos.legal": [ legalName, edrpou, legalAddress ] "tab.pos.size": [ timeWorkFrom, timeWorkTo, timeBreakFrom, timeBreakTo, numberOfCells, lengthShelf, salesSquare, whSquare, bStandart ] "tab.pos.contacts": [] "tab.pos.route_map": [] "tab.pos.order": [] "tab.pos.payment": [] actions: save: ~ list: ~ save-and-list: ~ show: params: title: "You're viewing the object \"%object%\"|{ %object%: YourModel.title }|" display: ~ #[ name ] actions: list: ~ new: ~ actions: params: object_actions: delete: ~ 

I need that when I work editEquipment: correct values ​​are substituted into the route, in particular the object ID.

 builders: list: params: max_per_page: 100 title: list.title.pos display: [ custId, rtiKey, name, address, settlement, employee, network, posType, posStatus ] actions: new: ~ object_actions: info: ~ edit: ~ editEquipment: route: Nitra_OutletBundle_BindPosEquipment params: id: \"%POS%\"|{ %id%: POS.Id }|" 

The documentation seems to be simple, but I can't.

    1 answer 1

    I figured it out. In "{{ POS.id }}" for the generator to substitute the values ​​from the scheme, they must be specified in the following format "{{ POS.id }}" . More documentation on this gang can be found at GIT .