# |
Sep 29th 2016, 22:15 |
Schalla |
That has the disadvantage that I have to add every single column of the base table as well, that's correct @ndm? |
# |
Sep 29th 2016, 22:12 |
ndm |
I'd think it's since 3.0 |
# |
Sep 29th 2016, 22:12 |
Schalla |
Interesting, I will give that a shot now, ty! |
# |
Sep 29th 2016, 22:11 |
ndm |
http://book.cakephp.org/3.0/en/controllers/components/pagination.html#control-which-fields-used-for-ordering |
# |
Sep 29th 2016, 22:11 |
Schalla |
ndm: Is that behavior new or already since release of 3.0? |
# |
Sep 29th 2016, 22:11 |
ndm |
@Schalla You must whitelist fields of associations |
# |
Sep 29th 2016, 22:10 |
Schalla |
Anyone ran into that issue before? |
# |
Sep 29th 2016, 22:10 |
Schalla |
Assuming Foo has a relation to Bar, when running having sort defined as "Bar.company", Foo's this->paginate results wont sort to the name of Bar.company |
# |
Sep 29th 2016, 22:07 |
royalty |
create* |
# |
Sep 29th 2016, 22:07 |
royalty |
something hacky i might be able to do is set a page title helper which simply echoes the value given to it or something |
# |
Sep 29th 2016, 22:07 |
Schalla |
Hi, I am having bad luck making the paginator work on association. It works fine on the base table, however, when running it on a assoc it just wont sort. |
# |
Sep 29th 2016, 22:06 |
royalty |
that won't work very easily in my case i'm afraid |
# |
Sep 29th 2016, 22:06 |
royalty |
heh |
# |
Sep 29th 2016, 22:05 |
Cake3Beginner |
@royalty: In PSpad Editor (http://www.pspad.com/) there is a function "Find and replace in Folder" where you can replace the variable name (string) in multiple files at once. Not sure about Sublime Text... |
# |
Sep 29th 2016, 22:02 |
prepender |
dereuromark: ty |
# |
Sep 29th 2016, 21:59 |
royalty |
is there a quick way to just attach a pageTitle property to the view class in 1.3 |
# |
Sep 29th 2016, 21:59 |
royalty |
so simply replacing them all to title_for_layouts would take long |
# |
Sep 29th 2016, 21:58 |
royalty |
I'm on cake 1.2 and want to upgrade to 1.3 the legacy code has a lot of $this->pageTitle defined in the view rather than the controller |
# |
Sep 29th 2016, 21:58 |
royalty |
hello cake geniouses |
# |
Sep 29th 2016, 21:55 |
harry1 |
can anyone help with this issue: http://stackoverflow.com/questions/39780485/cakephp-crud-api-filtering-fields |
# |
Sep 29th 2016, 21:54 |
dereuromark |
http://book.cakephp.org/3.0/en/orm/behaviors/counter-cache.html |
# |
Sep 29th 2016, 21:53 |
dereuromark |
isnt the behavior for it documented? |
# |
Sep 29th 2016, 21:53 |
dereuromark |
you mean counterCache? |
# |
Sep 29th 2016, 21:53 |
prepender |
used to be easy in cakephp2 |
# |
Sep 29th 2016, 21:53 |
prepender |
How do I make an automatic count column in cakephp 3 |
# |
Sep 29th 2016, 21:52 |
slackebot |
to configure the filter accordingly like `->add('Alias.created', 'Search.Callback', /* ... */)`. |
# |
Sep 29th 2016, 21:52 |
ndm |
@adityapansari Again my bad... should have known better, that's the behavior of the 1.x version. As of 2.x the fields that do not match any filter field name will be removed, ie, you have to go with the nesting solution, like `?created[0]=2016-09-01andcreated[1]=2016-09-03`. If you'd wanted to use named nested fields, then you'd have to nest everything under an alias, like `?Alias[created][from_date]=2016-09-01andAlias[created][to_date]=2016-09-03`, |
# |
Sep 29th 2016, 21:23 |
slackebot |
$args and got null array. [ ] |
# |
Sep 29th 2016, 21:23 |
adityapansari |
@ndm I tried. Query run. Thanks. ->add('created', 'Search.Callback', [ 'alwaysRun' => true, 'callback' => function ($query, $args, $manager) { debug($args); exit; return $query->andWhere(["Events.start >=" => new FrozenTime($args['from_date'])]) ->andWhere(["Events.start =" = new FrozenTime($args['to_date'])]); } ]); |
# |
Sep 29th 2016, 21:14 |
Cake3Beginner |
le/<locale>/cake.po." What is ment with the first sentence, do I need another cake.po outside the /de/ folder as well? |
# |
Sep 29th 2016, 21:14 |
Cake3Beginner |
Also in the book it says "The core strings messages extracted from the CakePHP library can be stored separately in a file named cake.po in src/Locale/. The CakePHP localized library houses translations for the client-facing translated strings in the core (the cake domain). To use these files, link or copy them into their expected location: src/Loca |
# |
Sep 29th 2016, 21:11 |
Cake3Beginner |
Sorry I ment "previous" and "next" as demo text in the index view (from pagination), not "preview"... |
# |
Sep 29th 2016, 21:11 |
Cake3Beginner |
e');" within the index action -> still english. Do I need to rename cake.po or something to get the core translations to work? Merci |
# |
Sep 29th 2016, 21:11 |
Cake3Beginner |
'cake.po' from /vendor/cakephp/localized/src/Locale/de/ to /src/Locale/de/ . First try: I changed 'defaultLocale' in app.php from 'en_US' to 'de' -> text is still in english. Second try: reversed first try, added in the table Controller 'use Cake\I18n\I18n;' and below I18n::locale('de'); -> still english. Third try: Moved the line "I18n::locale('d |
# |
Sep 29th 2016, 21:11 |
Cake3Beginner |
Hi there, I'm a bit confused about i18n setup in CakePHP 3 and need some help please. I made a blank CakePHP installation with composer (locally XAMPP), set up a simple test table in the database and used "cake bake all" to create controllers etc. By default all text is in english, e.g. "preview" and "next" in index view. I copied the language file |
# |
Sep 29th 2016, 21:01 |
jec |
thanks! |
# |
Sep 29th 2016, 20:57 |
ndm |
@jec possible, yes, but not adivsed, it's deprecated |
# |
Sep 29th 2016, 20:57 |
ndm |
@adityapansari I'm saying that by default the callback filter requires the configured field to be present in your search request, ie `created`, like `?created=1andfrom_date=...`, and that if if you want to avoid that, you could for example enable the `alwaysRun` option for your filter, and in your callback check the `$args` variable whether the fields required for your search (`from_date` and `to_date`) are present yourself before trying to modify |
# |
Sep 29th 2016, 20:50 |
jec |
I'm using 2.8.3 |
# |
Sep 29th 2016, 20:50 |
jec |
hi, is it still possible to use the email component from a controller like this: $this->Email ? |
# |
Sep 29th 2016, 20:47 |
adityapansari |
hey! In my case - created is the column name and from_date and to_date which are the form data. I did not get you. May you please give a example. thanks |