# |
Nov 24th 2017, 14:55 |
neon1024 |
Er, post lunch lull |
# |
Nov 24th 2017, 14:55 |
neon1024 |
Ah, well it is working. Just my element wasn’t outputting anything, lol |
# |
Nov 24th 2017, 14:53 |
JD-Robbs |
Sure $this->render('/Element/myelement'); |
# |
Nov 24th 2017, 14:52 |
neon1024 |
I’m just getting a blank response, no markup |
# |
Nov 24th 2017, 14:52 |
neon1024 |
For ajaxing, is it still possible in Cake 3 to return an element from the controller? |
# |
Nov 24th 2017, 14:51 |
neon1024 |
ksandeep, You don’t need to as the AuthComponent will take care of that for you |
# |
Nov 24th 2017, 13:31 |
ksandeep_ |
i mean by code how to check if page is white list to access without login? |
# |
Nov 24th 2017, 13:31 |
ksandeep_ |
hi frnds, how to check if login required to access a page. |
# |
Nov 24th 2017, 13:24 |
ziemmowit |
@voycey the thing is, I want those errors to happen. Reasons above. |
# |
Nov 24th 2017, 13:22 |
slackebot2 |
$this->redirect(['action' => 'index']); } I searched whole internet, but nothing helped. Tried \PDOException etc., and still nothing. CakePHP 3.5 (PHP 5) |
# |
Nov 24th 2017, 13:22 |
ziemmowit |
Hi, I will repeat my question, maybe someone will know the answer. I need to catch the exception on query in controller. Query depends on user input, so It is possible(and probable) that many times user will generate error. I tried this: try { $q = $this->MyClass->find('all'); [some joins] $q->where($string_based_on_user_input); $q->order($another_string_based_on_user_input) } catch(\Exception $e) { return |
# |
Nov 24th 2017, 12:43 |
neon1024 |
Ah, you can pass it via settings. That’s sensible :slightly_smiling_face: |
# |
Nov 24th 2017, 12:42 |
neon1024 |
I want to paginate via ajax, how do I tell the paginator which page I want? Just set the query param in the request? |
# |
Nov 24th 2017, 12:23 |
neon1024 |
Noone wants to read all that spaff |
# |
Nov 24th 2017, 12:23 |
neon1024 |
Or at least quote your code as code |
# |
Nov 24th 2017, 12:23 |
neon1024 |
Please use a paste service |
# |
Nov 24th 2017, 12:21 |
jbehling |
How do I pass this query to CakePHP 3? I'm trying to do so, but it compares in the ON column 'Services.id' as being a String and not a column |
# |
Nov 24th 2017, 12:19 |
neon1024 |
Something like `$this->request->allowMethod('get');` |
# |
Nov 24th 2017, 12:19 |
neon1024 |
Is there a neater way to replace this? `if (!$this->request->is('ajax')) { return; }` |
# |
Nov 24th 2017, 11:33 |
birdy247 |
went out in 3.5.5 :+1: |
# |
Nov 24th 2017, 11:32 |
birdy247 |
Ah I see |
# |
Nov 24th 2017, 11:30 |
birdy247 |
I am trying to find out the latest on this: https://github.com/UseMuffin/Webservice/pull/46#event-1311819540 |
# |
Nov 24th 2017, 11:29 |
birdy247 |
Hey @admad |
# |
Nov 24th 2017, 11:04 |
neon1024 |
@admad :wave: |
# |
Nov 24th 2017, 11:03 |
admad |
@cholthipaul you can the cakephp/orm or cakephp/database package standalone without rest of the framework |
# |
Nov 24th 2017, 10:54 |
neon1024 |
Perhaps check `minYear` and `maxYear` |
# |
Nov 24th 2017, 10:54 |
neon1024 |
https://book.cakephp.org/3.0/en/views/helpers/form.html#options-for-date-related-controls |
# |
Nov 24th 2017, 10:53 |
neon1024 |
Well read the book ;) It tells you about how to set the year |
# |
Nov 24th 2017, 10:53 |
clementcrown |
File uploaded https://cakesf.slack.com/files/U59RBAFS6/F85429M9A/image.png / https://slack-files.com/T053DPNCM-F85429M9A-3693e72732 - <@U1BT622HW> that will only make me to achieve something like this , however, the year is from 2012 to 2020, i want the date from 1900 till date. anyway, thanks |
# |
Nov 24th 2017, 10:50 |
neon1024 |
https://jsfiddle.net/tz5ccgqw/ |
# |
Nov 24th 2017, 10:49 |
neon1024 |
@clementcrown That’s just the HTML5 date picker. Just use `type => date` |
# |
Nov 24th 2017, 10:49 |
clementcrown |
i mean the pop up calendar , also the year stops at 2015, i want it to start from 1900 till date |
# |
Nov 24th 2017, 10:48 |
clementcrown |
File uploaded https://cakesf.slack.com/files/U59RBAFS6/F856WJHPF/image.png / https://slack-files.com/T053DPNCM-F856WJHPF-a953ab4d54 - please how can I achieve this ? |
# |
Nov 24th 2017, 10:25 |
willem |
that worked! |
# |
Nov 24th 2017, 10:23 |
felix |
@neon1024: yes, `$ds->config()` worked. thank you :+1: |
# |
Nov 24th 2017, 10:22 |
neon1024 |
You’ll need to do the same as @rudy1976s and refactor the code into a library and then implement that into both the Component and your own class |
# |
Nov 24th 2017, 10:22 |
neon1024 |
Components you’ll really struggle |
# |
Nov 24th 2017, 10:22 |
neon1024 |
Er ModelAwareTrait even, https://github.com/cakephp/cakephp/blob/master/src/Datasource/ModelAwareTrait.php |
# |
Nov 24th 2017, 10:21 |
neon1024 |
Well you can use loadModel by using the LocatorAwareTrait |
# |
Nov 24th 2017, 10:21 |
willem |
if i create my own class in src\Subfolder\MyClass.php, how can i use standard Cake Components like Auth and use loadModel and such? |
# |
Nov 24th 2017, 10:20 |
neon1024 |
Maybe you’re just missing the `()` ? |