Skip to content

Cake 2.4 to Symfony 5.1 #2705

@TomasVotruba

Description

@TomasVotruba

1. Controller → HttpKernel


2. Disptacher → Event Dispacher


3. Template .ctp to Twig

-<?php echo $this->Form->create('Right'); ?>
+{{ form_open(Right) }}
-<?php echo $this->Form->input('id'); ?>
+{{ form_row(Right.id) }}
-<?php echo $this->Form->end(__('Submit')); ?>
+{{ form_row(Right.Submit) }}
+{{ form_end(Right) }}

<div class="rights form">
<?php echo $this->Form->create('Right'); ?>
    <fieldset>
        <legend><?php echo __('Edit Right'); ?></legend>
    <?php
        echo $this->Form->input('id');
        echo $this->Form->input('right_category_id');
        echo $this->Form->input('name');
        echo $this->Form->input('label');
        echo $this->Form->input('description');
        echo $this->Form->input('Role');
    ?>
    </fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="actions">
    <h3><?php echo __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Form->postLink(__('Delete'), ['action' => 'delete', $this->Form->value('Right.id')], null, __('Are you sure you want to delete # %s?', $this->Form->value('Right.id'))); ?></li>
        <li><?php echo $this->Html->link(__('List Rights'), ['action' => 'index']); ?></li>
        <li><?php echo $this->Html->link(__('List Right Categories'), ['controller' => 'right_categories', 'action' => 'index']); ?> </li>
        <li><?php echo $this->Html->link(__('New Right Category'), ['controller' => 'right_categories', 'action' => 'add']); ?> </li>
        <li><?php echo $this->Html->link(__('List Roles'), ['controller' => 'roles', 'action' => 'index']); ?> </li>
        <li><?php echo $this->Html->link(__('New Role'), ['controller' => 'roles', 'action' => 'add']); ?> </li>
    </ul>
</div>

4. Database Active Rector to Doctrine ORM

  • relations
  • repository method
  • validatoin

5. Console commands to Symfony\Console

6. Events to EvenetDispatcher

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions