Skip to content

Commit 4682a1d

Browse files
committed
Try fixing formatting in rst file
1 parent e68c812 commit 4682a1d

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

docs/examples.rst

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Basic example
1818
1919
.. code-block:: php
2020
21-
<?php
2221
/*
2322
In the present example, these changes would be made in:
2423
src/Model/Table/UsersTable.php
@@ -47,21 +46,18 @@ Basic example
4746
]);
4847
}
4948
}
50-
?>
5149
5250
.. code-block:: php
5351
54-
<?php
5552
/*
5653
In the present example, these changes would be made in:
5754
templates/Users/add.php
5855
templates/Users/edit.php
5956
*/
60-
?>
61-
<?= $this->Form->create($user, ['type' => 'file']); ?>
62-
<?= $this->Form->control('username'); ?>
63-
<?= $this->Form->control('photo', ['type' => 'file']); ?>
64-
<?= $this->Form->end(); ?>
57+
echo $this->Form->create($user, ['type' => 'file']);
58+
echo $this->Form->control('username');
59+
echo $this->Form->control('photo', ['type' => 'file']);
60+
echo $this->Form->end();
6561
6662
Note: If you used *bake* to generate MVC structure after creating
6763
the users table, you will need to remove the default scalar validation
@@ -107,7 +103,6 @@ In order to prevent such situations, a field must be added to store the director
107103
108104
.. code-block:: php
109105
110-
<?php
111106
/*
112107
In the present example, these changes would be made in:
113108
src/Model/Table/UsersTable.php
@@ -138,22 +133,19 @@ In order to prevent such situations, a field must be added to store the director
138133
]);
139134
}
140135
}
141-
?>
142136
143137
.. code-block:: php
144138
145-
<?php
146139
/*
147140
In the present example, these changes would be made in:
148141
templates/Users/add.php
149142
templates/Users/edit.php
150143
*/
151-
?>
152144
153-
<?= $this->Form->create($user, ['type' => 'file']); ?>
154-
<?= $this->Form->control('username'); ?>
155-
<?= $this->Form->control('photo', ['type' => 'file']); ?>
156-
<?= $this->Form->end(); ?>
145+
echo $this->Form->create($user, ['type' => 'file']);
146+
echo $this->Form->control('username');
147+
echo $this->Form->control('photo', ['type' => 'file']);
148+
echo $this->Form->end();
157149
158150
Using such a setup, the behavior will use the stored path value instead of generating the path dynamically when deleting
159151
files.
@@ -187,7 +179,6 @@ This example uses the Imagine library. It can be installed through composer:
187179
188180
.. code-block:: php
189181
190-
<?php
191182
/*
192183
In the present example, these changes would be made in:
193184
src/Model/Table/UsersTable.php
@@ -250,21 +241,19 @@ This example uses the Imagine library. It can be installed through composer:
250241
]);
251242
}
252243
}
253-
?>
254244
255245
.. code-block:: php
256246
257-
<?php
258247
/*
259248
In the present example, these changes would be made in:
260249
templates/Users/add.php
261250
templates/Users/edit.php
262251
*/
263-
?>
264-
<?= $this->Form->create($user, ['type' => 'file']); ?>
265-
<?= $this->Form->control('username'); ?>
266-
<?= $this->Form->control('photo', ['type' => 'file']); ?>
267-
<?= $this->Form->end(); ?>
252+
253+
echo $this->Form->create($user, ['type' => 'file']);
254+
echo $this->Form->control('username');
255+
echo $this->Form->control('photo', ['type' => 'file']);
256+
echo $this->Form->end();
268257
269258
Displaying links to files in your view
270259
--------------------------------------
@@ -276,7 +265,6 @@ This example uses the `default behaviour configuration <configuration.html>`__ u
276265

277266
.. code-block:: php
278267
279-
<?php
280268
/*
281269
In the present example, variations on these changes would be made in:
282270
templates/Users/view.php
@@ -294,13 +282,11 @@ This example uses the `default behaviour configuration <configuration.html>`__ u
294282
// You could use the following to create a link to
295283
// the image (with default settings in place of course)
296284
echo $this->Html->link('../files/example/image/' . $entity->photo_dir . '/' . $entity->photo);
297-
?>
298285
299286
For Windows systems you'll have to build a workaround as Windows systems use backslashes as directory separator which isn't useable in URLs.
300287

301288
.. code-block:: php
302289
303-
<?php
304290
/*
305291
In the present example, variations on these changes would be made in:
306292
templates/Users/view.php
@@ -318,6 +304,5 @@ For Windows systems you'll have to build a workaround as Windows systems use bac
318304
// You could use the following to create a link to
319305
// the image (with default settings in place of course)
320306
echo $this->Html->link('../files/example/image/' . str_replace('\', '/', $entity->photo_dir) . '/' . $entity->photo);
321-
?>
322307
323308
You can optionally create a custom helper to handle url generation, or contain that within your entity. As it is impossible to detect what the actual url for a file should be, such functionality will *never* be made available via this plugin.

0 commit comments

Comments
 (0)