# |
Apr 29th 2017, 09:05 |
keith |
I’m trying to call an action and render the view using fields from a database to choose the plugin/controller/action etc. So I have prefix, controller, action fields in the database, currently i’m using requestAction to achieve this but it has been deprecated, so I’m wondering if there is a better way |
# |
Apr 29th 2017, 09:05 |
slackebot1 |
and should i use $this->set(compact($isadmin) in the beforerender()? |
# |
Apr 29th 2017, 09:03 |
burzum |
Joop, passing it where needed. The only place you'll probably always need it is the view. So just set it in beforeRender() |
# |
Apr 29th 2017, 09:02 |
joop |
i mean i need several places $isadmin variables(its indicates if admin is logged in or not) |
# |
Apr 29th 2017, 09:01 |
joop |
what is the best practise to store global variables? |
# |
Apr 29th 2017, 09:01 |
joop |
i would like to ask your openion |
# |
Apr 29th 2017, 09:00 |
joop |
hello guys have good moorning to you all |
# |
Apr 29th 2017, 07:49 |
admad |
@loginews your article can be summarized as "Trying your hand at webdev using a modern PHP framework involves a steep learning curve, when you current experience only involves using as very limiting s/w like MSAccess" |
# |
Apr 29th 2017, 07:24 |
hmic |
rudy1976s: what does "create" mean? yes, you can easily dispatch an event. you could even attach one, which is likely not what you want?! |
# |
Apr 29th 2017, 06:37 |
rudy1976s |
hello is possible to create a new event in a afterSave model callback ? |
# |
Apr 29th 2017, 06:26 |
loginews |
@hiromi2424 thanks |
# |
Apr 29th 2017, 06:25 |
loginews |
@metoyoko thanks |
# |
Apr 29th 2017, 06:24 |
loginews |
@hmic I started with cakephp 3 directly. I tried several times. I read the official book for version online. But I believe that the difficulty is that a lot of advanced features are also discussed in the same paragraphs, which make the newcomer helpless. I come from MsAccess platform. Here is what I wrote for myself, in order to clear up the fog: http://cakephp.loginonline.net |
# |
Apr 29th 2017, 06:13 |
hmic |
the book is very clear, 3.x as least as good as 2.x. even more comprehensive |
# |
Apr 29th 2017, 06:12 |
hmic |
are you reading the book or what kind of documentation are you talking about? |
# |
Apr 29th 2017, 06:11 |
metoyoko |
@loginews yes I agree with you that documentation for ver.2 is more readable and explained clearly than ver.3, based on my own experienced. |
# |
Apr 29th 2017, 06:05 |
hiromi2424 |
@metoyoko yeah it is. |
# |
Apr 29th 2017, 06:05 |
metoyoko |
@hiromi2424 afaik that input refers to hasOne association? correct me if im wrong thanks |
# |
Apr 29th 2017, 06:03 |
metoyoko |
@loginews heres the link: https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data |
# |
Apr 29th 2017, 06:01 |
hiromi2424 |
@loginews You can set association field like `Form->input('param.ADDRESS1')` |
# |
Apr 29th 2017, 06:00 |
hmic |
the book distinguishes between 2.x and 3.x very cleary, i's basically 2 different books with different urls to spot where you are on! |
# |
Apr 29th 2017, 05:59 |
loginews |
yes.... I did not see this in any documentation. It explains why we are getting difficulties. Also, a lot of documentation refer to version 2. You and I are using version 3 of cakephp. |
# |
Apr 29th 2017, 05:58 |
metoyoko |
you need to put .1. if you used hasMany inside your Model like: $this->hasMany('CmsLiquidationsDetails', [ 'foreignKey' => 'liquidations_header_id' ]); |
# |
Apr 29th 2017, 05:56 |
loginews |
where did you get the .1. ? from which documentation. I did not see that. |
# |
Apr 29th 2017, 05:54 |
metoyoko |
@loginews so far no answer. I figured it out that I need to encode inside form/template: $this->Form->control('cms_liquidations_details.1.category_id') instead of $this->Form->control('CmsLiquidationsDetails.1.category_id') and one thing there is no error prompted even in error.log shows empty. 2 days of trials and errors before I solved the problem. So It's so much appreciated if someonce share sample project that already used associatio |
# |
Apr 29th 2017, 05:45 |
loginews |
@metoyoko did anybody answer your question ? |
# |
Apr 29th 2017, 05:34 |
slackebot1 |
https://gist.github.com/loginews/78dbc099fe1689332c299002d361f472 Table param has only one record all the time. I want to edit the field ADDRESS1 (from param table) at the same time as the other fields in table users. I really don’t see how to do that. The docs are too complicated for me. |
# |
Apr 29th 2017, 05:34 |
loginews |
I would be very grateful if someone could help me out. I have already used CakePHP in 3 apps. I am slowly getting used to it. Whenever I am stuck, I can always go back to plain php to develop my application. I have no problem developing any app with plain php and mysql. So the problem is only with the learning the new language. I have a table users which I can edit successfully. See all the bits of codes here: |
# |
Apr 29th 2017, 05:34 |
loginews |
I have about the same difficulty as metoyoko |
# |
Apr 29th 2017, 05:10 |
backstageel |
Does the cakephp upgrade tool moves the prefixed actions to its own controller? |
# |
Apr 29th 2017, 03:34 |
metoyoko |
Where can I download working project that have hasMany and belongsToMany inside it. Thanks. |
# |
Apr 29th 2017, 03:28 |
metoyoko |
I Can't save using hasMany in cakephp 3. Is there any downloadable working cakephp 3 apps that has hasMany and belongsToMany inside it so I can figure out how to pass data from form to model. thanks |
# |
Apr 29th 2017, 03:25 |
metoyoko |
Good Day! |
# |
Apr 28th 2017, 20:28 |
graziel |
i find cake highly customizable as it gives you some basic things that you can follow but at the same time you might change almost every aspect of it |
# |
Apr 28th 2017, 20:28 |
graziel |
at start it might not have much sense but more and more you will use cake the more it will clear things up |
# |
Apr 28th 2017, 20:21 |
pc-world |
My first impression is that files like bootstrap.php which are over 200 lines in size should be part of the core if they are necessary, and not duplicated across every project built with Cake |
# |
Apr 28th 2017, 20:15 |
burzum |
In theory (never tried it) https://github.com/cakephp/app/blob/master/webroot/index.php this file should be enough. You can then start building whatever you want around it. ;) |
# |
Apr 28th 2017, 20:15 |
pc-world |
It doesn't really seem to be minimal, as the template includes SQL schemas (i18n.sql, sessions.ql), a sample test case, views, templates, CSS stuff etc. in webroot, can I delete all of that? |
# |
Apr 28th 2017, 20:13 |
burzum |
Nobody holds you off from creating all the other files, that you'll need in any case, manually if you prefer that. :slightly_smiling_face: |
# |
Apr 28th 2017, 20:12 |
temp1029 |
And btw, most of those 100 files are just placeholders for directories (about 50 I think) and then normal web front end stuff (CSS, images, etc) which don't affect your application logic |
# |
Apr 28th 2017, 20:10 |
dereuromark |
its as easy as that |