# |
Feb 9th 2018, 21:26 |
kevin |
is there any where I could have looked to find this without asking in slack? |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
;) |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
$this->Time->parse($widget['time'])->nice('-7:00'); |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
$this->Time->parse(); |
# |
Feb 9th 2018, 21:23 |
kevin |
So how do you use it them? If I try to use $time = Time::parse($widget[‘time’]); $time->nice(‘-07:00’), I get errors about using Time:: |
# |
Feb 9th 2018, 21:05 |
night_wulfe |
Does anyone unit test their model relationships, or is that considered testing the framework? |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
you don't have to do any of that |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
it's included by default through Core or something |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
nah |
# |
Feb 9th 2018, 20:04 |
kevin |
for TimeHelper, its used in the view, but do you put the ‘use Cake\View\Helper\TimeHelper’ line in the controller, or at the top of the viw? |
# |
Feb 9th 2018, 19:53 |
devito |
afterFind method of a model, Do i need to also re call $this->save($entity)? |
# |
Feb 9th 2018, 19:50 |
aro |
to save it |
# |
Feb 9th 2018, 19:50 |
aro |
mark, with your tag plugin, do all we need is a comma delimited field called 'tag_list' with the model that is being tagged? |
# |
Feb 9th 2018, 19:48 |
kevin |
is there something baked into cakephp that can automagically handle timezones? like, if I have a timezone variable for the users session |
# |
Feb 9th 2018, 19:02 |
madrid998 |
ah yes |
# |
Feb 9th 2018, 19:02 |
dereuromark |
array diff methods on table->schema() fields |
# |
Feb 9th 2018, 19:02 |
madrid998 |
What is the best way to query a table of 30 fields for all fields, expect 1 of the fields. Do I need to list all fields, or is there a way to use a wildcard or 'omit' 1 field? |
# |
Feb 9th 2018, 18:48 |
spencdev |
^ `$this->viewBuilder()->setLayout()` in cakephp 3.4+ |
# |
Feb 9th 2018, 18:19 |
dereuromark |
you can always switch layout based on this |
# |
Feb 9th 2018, 18:18 |
kevin |
I have auth’d and unauth’d default files. |
# |
Feb 9th 2018, 18:18 |
kevin |
is there a way to have multiple ‘default.ctp’ files? |
# |
Feb 9th 2018, 18:14 |
dereuromark |
prefix has always higher precedence for me than any plugin etc. you can sure try. |
# |
Feb 9th 2018, 18:14 |
dereuromark |
i dont want to :slightly_smiling_face: |
# |
Feb 9th 2018, 18:13 |
alysson-azevedo |
In your example, you defined `$routes->connect('/admin', ['prefix' => 'admin', 'controller' => 'Overview', 'action' => 'index']);` inside `/` scope, and then difined the prefix. Would it works if you defined `->connect ('/', [...])` inside the prefix 'admin'? |
# |
Feb 9th 2018, 18:09 |
dereuromark |
as you can see in my posted examples. |
# |
Feb 9th 2018, 18:09 |
dereuromark |
well, the idea is to define your custom ones first, rest is then convention based. |
# |
Feb 9th 2018, 18:08 |
alysson-azevedo |
but thanks for that example anyways |
# |
Feb 9th 2018, 18:08 |
alysson-azevedo |
`$routes->fallbacks()` feels pretty critical for something described as _The fallbacks method is a simple shortcut for defining default routes._ on docs. |
# |
Feb 9th 2018, 18:03 |
dereuromark |
convention based routing |
# |
Feb 9th 2018, 18:03 |
alysson-azevedo |
i'll read what it does |
# |
Feb 9th 2018, 18:03 |
alysson-azevedo |
it was missing a `$routes->fallbacks();` inside the prefix declaration |
# |
Feb 9th 2018, 17:59 |
jkarlmen |
@neon1024 got it |
# |
Feb 9th 2018, 17:58 |
dereuromark |
ok |
# |
Feb 9th 2018, 17:57 |
alysson-azevedo |
i'll debug and post results later |
# |
Feb 9th 2018, 17:57 |
dereuromark |
what do you mean? I always declare it outside: https://github.com/dereuromark/cakephp-sandbox/blob/3.0/config/routes.php#L39 |
# |
Feb 9th 2018, 17:56 |
alysson-azevedo |
I worked before when prefix was outside |
# |
Feb 9th 2018, 17:55 |
alysson-azevedo |
Yeah. I declared the prefix route inside a `/` scope |
# |
Feb 9th 2018, 17:54 |
dereuromark |
most likely your prefix routing has an issue then |
# |
Feb 9th 2018, 17:54 |
dereuromark |
you should paste a pastebin url with your code, including the routes.php setup |
# |
Feb 9th 2018, 17:52 |
alysson-azevedo |
Hi guys. I have a route with xlsx configured. When i make a request `GET /records.xls` it works fine. But on my html view, i have `ech$this->Html->link('Excel file', ['_ext' => 'xlsx'])` that raises an error: ``` Error: A route matching "array ( '_ext' => 'xlsx', 'action' => 'index', 'prefix' => 'reports', 'plugin' => NULL, 'controller' => 'Records', )" could not be found. ``` |
# |
Feb 9th 2018, 17:44 |
dereuromark |
find('tagged') is the custom finder |