# |
Jul 18th 2018, 13:42 |
josbeir |
@mr.mjsm remove the last line out of the else block, 'company' should not be set conditionally |
# |
Jul 18th 2018, 13:42 |
admad |
@mr.mjsm use an editor with auto formatter feature or one which runs phpcs in background and highlights mis-formatted code |
# |
Jul 18th 2018, 13:41 |
flavius |
you gotta give him that |
# |
Jul 18th 2018, 13:41 |
mr.mjsm |
I wrote the code then added the brackets so it was manually :upside_down_face: |
# |
Jul 18th 2018, 13:41 |
flavius |
i mean, at least he aint using TABS :) |
# |
Jul 18th 2018, 13:41 |
josbeir |
:) |
# |
Jul 18th 2018, 13:40 |
josbeir |
remind me to never post any code in here ... |
# |
Jul 18th 2018, 13:40 |
flavius |
that's his way of standing out :P |
# |
Jul 18th 2018, 13:40 |
flavius |
maybe he likes being special |
# |
Jul 18th 2018, 13:40 |
josbeir |
for what it does its also very ... euhm.. verbose |
# |
Jul 18th 2018, 13:40 |
admad |
which begs the question why he hasn't done it |
# |
Jul 18th 2018, 13:40 |
flavius |
come on guys, its not that bad, most editors will auto-format it for you :P |
# |
Jul 18th 2018, 13:40 |
josbeir |
haha thats one way to look at it |
# |
Jul 18th 2018, 13:39 |
admad |
@josbeir that's one way to ensure long term employment. No one else can read your code :slightly_smiling_face: |
# |
Jul 18th 2018, 13:37 |
josbeir |
:- |
# |
Jul 18th 2018, 13:37 |
flavius |
shut up @josbeir, he's got enough problems as it is :P |
# |
Jul 18th 2018, 13:37 |
josbeir |
i just ate... |
# |
Jul 18th 2018, 13:37 |
josbeir |
shit @mr.mjsm do something about those brackets |
# |
Jul 18th 2018, 13:36 |
mr.mjsm |
i really don't know what i am doing wrong |
# |
Jul 18th 2018, 13:36 |
mr.mjsm |
@admad everything was working fine, what I wanted instead of creating the email in a separate page i wanted to force the creating of at least one email with the company. |
# |
Jul 18th 2018, 13:34 |
admad |
@mr.mjsm here's what I suggest. Start with a copy of database with proper names as per conventions. Then bake will do most of the things for you. Once you have everything working then you will just have to use ->setTable() in the table class to use the wacky table names like "companys" |
# |
Jul 18th 2018, 13:33 |
turkles |
or need a set in the above at the end |
# |
Jul 18th 2018, 13:33 |
turkles |
you don't need the else |
# |
Jul 18th 2018, 13:33 |
turkles |
but that won't exist if it fails |
# |
Jul 18th 2018, 13:33 |
mr.mjsm |
yup |
# |
Jul 18th 2018, 13:32 |
flavius |
`$this->set(compact('company'));` |
# |
Jul 18th 2018, 13:32 |
flavius |
it should work, you have that else statement there which sets the variable $company in your view |
# |
Jul 18th 2018, 13:31 |
mr.mjsm |
i am not the one who designed the database ;( |
# |
Jul 18th 2018, 13:30 |
flavius |
that should work but like somebody else told you... the plural for companies is just that, not companys |
# |
Jul 18th 2018, 13:29 |
flavius |
holy shit nice brackets :P |
# |
Jul 18th 2018, 13:27 |
mr.mjsm |
File uploaded https://cakesf.slack.com/files/UBN7KUDRA/FBSQT41GV/-.php / https://slack-files.com/T053DPNCM-FBSQT41GV-3a6739b0d1 |
# |
Jul 18th 2018, 13:27 |
mr.mjsm |
i didn't remove anything from there just added extra things. here is the code |
# |
Jul 18th 2018, 13:26 |
flavius |
you changed the controller, do you still have $this->set('company', $company) in your add action? |
# |
Jul 18th 2018, 13:26 |
turkles |
ha, I have no problem with pay to win if I run the game.. but it sucks when I am just a player. I am too poor. |
# |
Jul 18th 2018, 13:25 |
mr.mjsm |
this is line 14 "<?= $this->Form->create($company) ?>" |
# |
Jul 18th 2018, 13:25 |
flavius |
:P |
# |
Jul 18th 2018, 13:25 |
flavius |
GET HIM OUT OF HERE |
# |
Jul 18th 2018, 13:25 |
turkles |
top dawg has to look over his shoulder |
# |
Jul 18th 2018, 13:25 |
flavius |
PAY 2 WIN |
# |
Jul 18th 2018, 13:25 |
mr.mjsm |
any idea how to solve this problem "Undefined variable: company [APP/Template\Companys\add.ctp, line 14]" it used to work fine. but i made some changes in the add method in the controller. i don't see why it affected the variable in the add page! i didn't change much there. all i did was loading a model to submit 2 forms at once. |
# |
Jul 18th 2018, 13:25 |
flavius |
WHAT |