# |
Jun 10th 2018, 10:44 |
graziel |
bin/cake bake model Users |
# |
Jun 10th 2018, 10:43 |
gannher |
thanks |
# |
Jun 10th 2018, 10:43 |
gannher |
ok i will try |
# |
Jun 10th 2018, 10:43 |
graziel |
try to bake it, making things by hand can lead to silly typos like UsresTable.php |
# |
Jun 10th 2018, 10:43 |
gannher |
<?= $this->Form->create($user, ['url' => ['controller' => 'Users', 'action' => 'add']]); ?> |
# |
Jun 10th 2018, 10:42 |
saeideng |
for form or use `create([])` |
# |
Jun 10th 2018, 10:40 |
gannher |
class UsersTable extends Table |
# |
Jun 10th 2018, 10:40 |
gannher |
made by hand |
# |
Jun 10th 2018, 10:39 |
graziel |
yeah but its a side note : ) , just to be sure if you are loading correctly UsersTable did you bake it or made it by hand? |
# |
Jun 10th 2018, 10:38 |
gannher |
ok |
# |
Jun 10th 2018, 10:38 |
saeideng |
and sent this entity to form `create($entity` |
# |
Jun 10th 2018, 10:38 |
gannher |
$user = $this->Users->newEntity($this->request->getData()); |
# |
Jun 10th 2018, 10:37 |
gannher |
i will try |
# |
Jun 10th 2018, 10:37 |
gannher |
ok |
# |
Jun 10th 2018, 10:37 |
saeideng |
newEntity() |
# |
Jun 10th 2018, 10:37 |
gannher |
i need use var $users in form ? |
# |
Jun 10th 2018, 10:37 |
saeideng |
first create an entity |
# |
Jun 10th 2018, 10:34 |
graziel |
also on side note `Form->create('Users'` you need to pass entity object here |
# |
Jun 10th 2018, 10:33 |
graziel |
are you sure that UsersTable is correctly loaded? |
# |
Jun 10th 2018, 10:13 |
gannher |
Finally, I try with newEntity and validationDefault method is not call. I post a ask question on stackoverflow : https://stackoverflow.com/questions/50781524/how-to-use-validationdefault-method-in-cakephp-3 |
# |
Jun 10th 2018, 10:08 |
kitcat711_ |
found it: was closing </html> right after opening it ... silly me |
# |
Jun 10th 2018, 10:05 |
lorenzo |
@tylergel sounds like you are not posting, or are debugging after a redirect |
# |
Jun 10th 2018, 09:53 |
kitcat711_ |
but i keep on seeing the default cake favicon, what am I missing?. |
# |
Jun 10th 2018, 09:52 |
kitcat711_ |
['type' => 'icon']);?> |
# |
Jun 10th 2018, 09:52 |
kitcat711_ |
<?php echo $this->Html->meta('favicon.ico','img/front/favicon-home.ico', |
# |
Jun 10th 2018, 09:52 |
kitcat711_ |
hello, in my default.ctp file, within the HEAD section, I have put : |
# |
Jun 10th 2018, 09:52 |
kitcat711_ |
['type' => 'icon']);?> |
# |
Jun 10th 2018, 09:52 |
kitcat711_ |
<?php echo $this->Html->meta('favicon.ico','img/front/favicon-home.ico', |
# |
Jun 10th 2018, 09:11 |
tylergel |
Nothing, I do if($this->request->is($_POST) { debug($this->request->data); } And when I submit the form I get "[]" |
# |
Jun 10th 2018, 09:05 |
lorenzo |
what’s in $_POST? |
# |
Jun 10th 2018, 09:04 |
tylergel |
What could be causing $this->request->data to always be empty after submitting form in cakephp 3? |
# |
Jun 10th 2018, 08:53 |
lorenzo |
loading them on each function is not too bad |
# |
Jun 10th 2018, 08:53 |
lorenzo |
what are you trying to do? |
# |
Jun 10th 2018, 08:37 |
birdy247 |
I tried using a constructor, but it didnt like this |
# |
Jun 10th 2018, 08:37 |
birdy247 |
or should i just load them in each function? |
# |
Jun 10th 2018, 08:37 |
birdy247 |
@lorenzo is there a "best approach" to loading models in a listener |
# |
Jun 10th 2018, 08:29 |
graziel |
ok will do |
# |
Jun 10th 2018, 08:26 |
lorenzo |
just go with anything :slightly_smiling_face: |
# |
Jun 10th 2018, 08:10 |
graziel |
lets say i would like to create some cake tutorial, does cake have some preferred blog site that it wants to focus on or just go with anything? |
# |
Jun 10th 2018, 08:01 |
gannher |
thanks :) |
# |
Jun 10th 2018, 08:00 |
birdy247 |
@lorenzo thanks |