# |
Mar 7th 2018, 16:11 |
popperz0r |
thanks once again @jeremyharris second day in a round to save my day :P |
# |
Mar 7th 2018, 16:10 |
popperz0r |
ill take a look at utility classes |
# |
Mar 7th 2018, 16:07 |
jeremyharris |
I find it a bit strange that the controller layer needs to know that, but a utility class would do what you want |
# |
Mar 7th 2018, 16:07 |
jeremyharris |
as an example in the core, look at the TextHelper and how it basically proxies the utility Text class |
# |
Mar 7th 2018, 16:07 |
popperz0r |
its an all app related, so i can be able to generate a classname from wherever i want, its just a string to match my css |
# |
Mar 7th 2018, 16:06 |
jeremyharris |
or, create a basic service/utility class that the model/component/whatever else share |
# |
Mar 7th 2018, 16:06 |
jeremyharris |
if it’s something that is table/model related, move the logic into the table and call the table method from the component |
# |
Mar 7th 2018, 16:05 |
popperz0r |
What do you guys advise? |
# |
Mar 7th 2018, 16:05 |
popperz0r |
but looks like im not suposed to call components inside models |
# |
Mar 7th 2018, 16:05 |
popperz0r |
Now i want to call it to auto-add a class on a model beforesave |
# |
Mar 7th 2018, 16:05 |
popperz0r |
I created a component to generate random html classes, this could be used for anything |
# |
Mar 7th 2018, 16:04 |
popperz0r |
Hi! I have an architecture problem here! :P |
# |
Mar 7th 2018, 15:30 |
neon1024 |
Actually, nevermind. I should refactor the script out of the element. |
# |
Mar 7th 2018, 15:30 |
neon1024 |
Anyone know how to have an element which is included multiple times, only append to the script block once? |
# |
Mar 7th 2018, 15:29 |
charolastra |
but the PagesController doesn't pass them on. but thinking of it the PagesController might not be suitable for that |
# |
Mar 7th 2018, 15:28 |
roel |
@neon1024 Ok, I'll look into that :slightly_smiling_face:, Thanks |
# |
Mar 7th 2018, 15:28 |
neon1024 |
charolastra: $this->redirect() takes an array url, so you can pass whatever url options you want |
# |
Mar 7th 2018, 15:27 |
neon1024 |
No harm in that @roel but do think about if you’d be better served with a Behavior instead |
# |
Mar 7th 2018, 15:20 |
roel |
Hello, Is there a reason why I shouldn't make an extra layer between the Table and for example UsersTable? Let's call this new layer "AppTable", AppTable will extend Table, and UsersTable will extend AppTable. Table -> AppTable -> UsersTable This new layer holds global functions. |
# |
Mar 7th 2018, 15:14 |
charolastra |
hi, how to pass arguments/variables to a redirect on the PagesController? |
# |
Mar 7th 2018, 14:33 |
sam_indi |
will that be issue? |
# |
Mar 7th 2018, 14:33 |
sam_indi |
@neon1024: I think I am missing authentication type in curl request |
# |
Mar 7th 2018, 14:30 |
sam_indi |
This is my curl request |
# |
Mar 7th 2018, 14:30 |
sam_indi |
https://thepasteb.in/p/0ghJWyo9GPgc5 |
# |
Mar 7th 2018, 14:29 |
sam_indi |
Yes because it is already using blowfish and this channel just reversed the order of my msg. I have sent paste bin as first msg. You can see Blowfish is already used |
# |
Mar 7th 2018, 14:29 |
neon1024 |
You probably want to change your Authentication type, https://book.cakephp.org/2.0/en/core-libraries/components/authentication.html |
# |
Mar 7th 2018, 14:28 |
neon1024 |
Is this a serious question? |
# |
Mar 7th 2018, 14:28 |
neon1024 |
You ask where you can change “Blowfish” and then paste code with the word “Blowfish” in it. |
# |
Mar 7th 2018, 14:27 |
sam_indi |
Where can I change that string, I have just made a curl request from another server |
# |
Mar 7th 2018, 14:27 |
sam_indi |
https://thepasteb.in/p/mwh1YMJ4Z0Ac5 |
# |
Mar 7th 2018, 14:26 |
neon1024 |
Sorry, I can’t help you with that. |
# |
Mar 7th 2018, 14:26 |
neon1024 |
Hah! |
# |
Mar 7th 2018, 14:26 |
santosh.madeti |
@neon1024 Cakephp version is 1.3 |
# |
Mar 7th 2018, 14:25 |
neon1024 |
sam_indi: It sounds like your application is using blowfish for the AuthComponent perhaps, but the string you’re using in your salt isn’t compatible |
# |
Mar 7th 2018, 14:25 |
santosh.madeti |
@neon1024 Thanks, The query format is like $this -> Estimate -> Patient -> find(array), I need to debug this query .. |
# |
Mar 7th 2018, 14:25 |
sam_indi |
This is components array for app controller: |
# |
Mar 7th 2018, 14:24 |
neon1024 |
@santosh.madeti You can use `$query->sql()` but do remember that it’s a PDO prepared statement, so the params will not be included in the output sql |
# |
Mar 7th 2018, 14:22 |
sam_indi |
I am passing the correct data, but still getting unauthorized |
# |
Mar 7th 2018, 14:20 |
sam_indi |
{ "name": "Unauthorized", "message": "Unauthorized", "url": "\/assets.json" } |
# |
Mar 7th 2018, 14:20 |
sam_indi |
Warning (512): Invalid salt: 1 for blowfish Please visit http://www.php.net/crypt and read the appropriate section for building blowfish salts. [CORE/Cake/Utility/Security.php, line 290] |
# |
Mar 7th 2018, 14:20 |
sam_indi |
This is the error I am getting: |