# |
Apr 26th 2017, 12:25 |
inoas |
may I ask what you are using yangqi/htmldom for primarily? |
# |
Apr 26th 2017, 12:25 |
dereuromark |
your welcome |
# |
Apr 26th 2017, 12:25 |
inoas |
why reinvent the wheel, I am going to use the plugin :) |
# |
Apr 26th 2017, 12:09 |
inoas |
thanks |
# |
Apr 26th 2017, 12:09 |
inoas |
https://github.com/dereuromark/cakephp-tools/blob/master/src/Utility/Language.php#L72 |
# |
Apr 26th 2017, 12:02 |
inoas |
fetch the most appropiate thing |
# |
Apr 26th 2017, 12:02 |
inoas |
heh |
# |
Apr 26th 2017, 12:02 |
inoas |
I need to get a ranked list and then run that ranked list against a ranked sql query |
# |
Apr 26th 2017, 12:01 |
dereuromark |
inoas: I use my own Language::findFirstMatch(['de', 'en']); from Tools, in my apps. |
# |
Apr 26th 2017, 12:00 |
awi |
and then mysql tells you SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens |
# |
Apr 26th 2017, 12:00 |
dereuromark |
you might have to enhance it a bit |
# |
Apr 26th 2017, 11:59 |
inoas |
public function acceptLanguage($language = null) in ServerRequest doesnt |
# |
Apr 26th 2017, 11:59 |
inoas |
accept language doesnt rate based on browser setting afaik |
# |
Apr 26th 2017, 11:59 |
awi |
so like an array [8 => 9, 10 => 11] will end in :c8 and :c10 in the query |
# |
Apr 26th 2017, 11:59 |
dereuromark |
@admad Is is possible for this i18n middleware to just detect and set Configure:: lang? Without the redirect? I bet that would be useful for far more projects this way - maybe it can be configurable redirect => true/false ? |
# |
Apr 26th 2017, 11:58 |
awi |
hi. i stumbled across a weird problem with the Queries... if you use some sort if $query->where([Entities.id IN => $arraylist]); and the identifiers in the query are mixed up (f.e. you got them from somewhere else) its using those array ids as :c{array-ID}:... |
# |
Apr 26th 2017, 11:58 |
inoas |
was just looking for something like this http://php.net/manual/fa/function.http-negotiate-language.php |
# |
Apr 26th 2017, 11:57 |
dereuromark |
When I was talking about i18n plugin I meant https://github.com/ADmad/cakephp-i18n/blob/master/src/Middleware/I18nMiddleware.php |
# |
Apr 26th 2017, 11:57 |
dereuromark |
A custom middleware would be it. |
# |
Apr 26th 2017, 11:56 |
inoas |
is there anything that negotiages language preferences by the user |
# |
Apr 26th 2017, 11:44 |
bgrinter |
The easy thing is to remove the constraint, but I want to understand if its a cakePHP bug or something stupid I've done. |
# |
Apr 26th 2017, 11:43 |
bgrinter |
We have similar constraints on other tables e.g. CONSTRAINTfk_member_units_membersFOREIGN KEY (member_id) REFERENCESmembers(id) 'MemberUnit' => array('dependent' => true) |
# |
Apr 26th 2017, 11:43 |
bgrinter |
I have a constraint on the member_stats table CONSTRAINTfk_member_stats_membersFOREIGN KEY (member_id) REFERENCESmembers(id) The member model has the following public $hasOne = array( 'MemberStat' => array('dependent' => true) ); and the memberStatus model has public $belongsTo = array('Member'); |
# |
Apr 26th 2017, 11:43 |
bgrinter |
Error: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (aal_online_admin_test.member_stats, CONSTRAINT fk_member_stats_members FOREIGN KEY (member_id) REFERENCES members (id)) |
# |
Apr 26th 2017, 11:43 |
bgrinter |
I have a problem trying to delete a record in cakephp (2.9.5) with a HasOne relationship |
# |
Apr 26th 2017, 11:38 |
willem |
is it possible to redirect to another scope inside a routing scope? for example. i want all my / request to go to /scope-x (which indead is a routing scope) |
# |
Apr 26th 2017, 11:16 |
julez |
'div' => true didn't worked |
# |
Apr 26th 2017, 11:15 |
julez |
is there a way to wrap a button in a div with FormHelper in Cake 2.x? |
# |
Apr 26th 2017, 11:00 |
inoas |
but I need to get to $session->read('User.locale_code') |
# |
Apr 26th 2017, 11:00 |
inoas |
it just feels wrong to do $session = new Session; in function parse |
# |
Apr 26th 2017, 10:49 |
dereuromark |
hm, you are right |
# |
Apr 26th 2017, 10:49 |
MaxSolace |
how to close or reconnect mysql database connection in cakephp 3? |
# |
Apr 26th 2017, 10:48 |
inoas |
but I am more about resolving urls |
# |
Apr 26th 2017, 10:48 |
inoas |
https://github.com/ADmad/cakephp-i18n/blob/master/src/Routing/Filter/I18nFilter.php |
# |
Apr 26th 2017, 10:48 |
inoas |
its still using dispatch filters (so middleware) |
# |
Apr 26th 2017, 10:46 |
dereuromark |
checkout the Admad/I18n plugin, I think it contains a few ideas on that |
# |
Apr 26th 2017, 10:45 |
dereuromark |
I still vote to keep them, the visibility part is super transparent with them, especially without code IDE highlighting in diffs and other sources. |
# |
Apr 26th 2017, 10:45 |
inoas |
should routing be done in middleware? |
# |
Apr 26th 2017, 10:45 |
inoas |
is that something that "should" be done in middleware? |
# |
Apr 26th 2017, 10:45 |
inoas |
what's the best way to read browser locale and session locale from routes? |
# |
Apr 26th 2017, 10:44 |
dereuromark |
Many find them super useful. |