Re: CakePHP Forum launched!

2016-05-03 Thread euromark
This forum should be closed and switched to read only.
The other one should now be the only one in use.

See the PRs to change the links on the CakePHP sites and documentation etc.
Mark


Am Dienstag, 3. Mai 2016 03:01:20 UTC+2 schrieb Reuben:
>
> Maybe this post should get stickied / pinned, so people know all the 
> action should now be at discourse.cakephp.org.
>
> Regards
> Reuben Helms
>
> On Tuesday, 26 April 2016 03:02:49 UTC+10, Megan Lalk wrote:
>>
>> CakePHP Forum launched!
>>
>> *We asked you what you wanted and the feedback was clear! Sign up 
>>  here - **http://discourse.cakephp.org/ 
>> *
>>
>> As you know, a CakePHP forum  is a 
>> welcomed platform by many! - From today, you  can be a part of the 
>> discussion and post your questions, find out the answers and make comments 
>> - all stored in one easy location!
>>
>> Our Google group has been a great place for many developers over the 
>> years, but also comes with a few difficulties. Results from our poll came 
>> in, and the consensus was that we needed a place where we could ask our 
>> questions, find out what others were asking and seek the advise from 
>> others. This platform allows for better interaction with your community!
>>
>> Well there you have it, besides our #CakePHP channel on IRC 
>> , Slack 
>>  channel, Stackoverflow 
>>  and our community 
>> newsletter; You can now also find us on our new CakePHP Forum 
>> .
>>
>>
>>   
>> Larry E. Masters
>>   
>> Co-Founder CakePHP
>>
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp 3 modular programming

2016-04-20 Thread euromark
It's called plugins
https://github.com/FriendsOfCake/awesome-cakephp etc

Mark


Am Mittwoch, 20. April 2016 18:26:27 UTC+2 schrieb Anurag Kumar:
>
> Is it possible to do modular programming with cakePHP 3.
>
> If yes please provide some example on it.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Replacement Date Widget

2016-04-01 Thread euromark
Side-note:
A lot of browsers still do not fully support that. Make sure that you at 
least provide a shim/fallback for those.

Mark



Am Donnerstag, 31. März 2016 02:32:39 UTC+2 schrieb Justin Harrison:
>
> I would like to replace the default date widget in CakePHP3 with the HTML5 
> date tag. I would have thought that was quite straight forward but have hit 
> a dead end each time.
> Does anyone have any example code that works here?
>
> Justin
>
>
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Role Authorization for controllers and methods

2016-03-27 Thread euromark
I use https://github.com/dereuromark/cakephp-tinyauth to exactly prevent 
this complicated if/switch statement logic from happening all over the 
controllers ;)
One simple to configure ini file, done.
Mark


Am Sonntag, 27. März 2016 11:43:31 UTC+2 schrieb LSRX4EVER:
>
> Hello Everyone,
>
> I'm a beginner CakePHP 3 developer. I learned fairly quick for my skill 
> level. 
> I'm currently working on a management system for a school, where there 
> will be a couple of roles that will only access specific controller 
> functions. (Student, Instructor, Supervisor, Administrator)
> HOWEVER, each user has a user state that I must validate and set 
> permission temporarily for users
> Example:
>
> Active User
> LoginEnter code here...
> Redirected to their role controller, with only access to those methods in 
> that controller
>
> Inactive User (used for setup)
> Login
> Confirm Account Information
> only aloud to access that setup() action
> once confirmed, it will set the user active and log them out
>
> Disabled User
> Is disabled, unauthorized user. Already have that configured
>
>
> My login function looks like:
> public function login()
> {
> $this->viewBuilder()->layout('login'); 
> if($this->Auth->user()){
> return $this->redirect(['controller'=>'Users','action'=>'index']); //index 
> redirect for now
> } else {
> if($this->request->is('post')){
> $user = $this->Auth->identify();
> $login_error=null;
> if($user){
> $session = $this->request->session(); 
> switch($user['user_status']){
> case '1': //Active - Normal Login
> unset($user['created'], $user['expiration'], $user['user_status'], 
> $user['security_question_answer'], $user['security_question_id'], 
> $user['modified']);
> $userid=$user['id'];
> //$user= array_merge($user, array('Roles' => 
> $this->Users->Roles->find('list', ['order' => ['Roles.role_id' => 
> 'ASC']])->matching('Users', function ($q) use ($userid) {return 
> $q->where(['Users.id' => $userid]);})->toArray()));
> $user = array_merge($user, 
> array('role'=>key($this->Users->Roles->find('list', ['order' => 
> ['Roles.role_id' => 'ASC']])->select(['Roles.role_id'])->matching('Users', 
> function ($q) use ($userid) { return $q->where(['Users.id' => 
> $userid]);})->limit(1)->toArray(;
> $user = array_merge($user, array('user_status' => 1));
> $this->Auth->setUser($user);
> return $this->redirect($this->Auth->redirectUrl('/users/index'));
> break;
> case '2': //Disabled 
> $login_error=1;
> $this->set(compact('login_error'));
> break;
> case '3': //Inactive - Redirect to setup method
> unset($user['created'], $user['expiration'], $user['user_status'], 
> $user['security_question_answer'], $user['security_question_id'], 
> $user['modified']);
> $userid=$user['id'];
> //$user= array_merge($user, array('roles' => 
> $this->Users->Roles->find('list', ['order' => ['Roles.role_id' => 
> 'ASC']])->matching('Users', function ($q) use ($userid) {return 
> $q->where(['Users.id' => $userid]);})->toArray()));
> $user = array_merge($user, 
> array('role'=>key($this->Users->Roles->find('list', ['order' => 
> ['Roles.role_id' => 'ASC']])->select(['Roles.role_id'])->matching('Users', 
> function ($q) use ($userid) { return $q->where(['Users.id' => 
> $userid]);})->limit(1)->toArray()), 'status' => 3));
> $this->Auth->setUser($user); //Auth Role to only allow inactive user 
> privilage to login, recovery and setup?
> /*this isnt right*/ return 
> $this->redirect($this->Auth->redirectUrl('/users/setup'));
> break;
> }
> } 
> if($login_error!=1){
> $login_error=0;
> };
> $this->set(compact('login_error'));
> }
> }
> }
>
> My AppController BeforeFilter looks like:
> public function beforeFilter(Event $event)
> {
> $this->Auth->allow(['/users/login', '/users/recovery']);
> /*
> switch(user_status){
> case 'Active'
> switch(role){
> case 'Student'
> allow student controller methods
> break;
> case 'Supervisor'
> allow supervisor controller methods
> break;
> case 'Instructor'
> allow instructor controller methods
> break;
> case 'Administrator'
> allow administrator controller methods
> break;
> }
> deny login and recovery methods
> break;
> case 'Inactive'
> allow setup and logout methods
> deny login and recovery methods
> break;
> default:
> allow login and recovery methods
> break;
> }
> */
> }
>
>
> I have looked at some things, I am running a basic authentication system 
> and I heard of Access Control Lists (ACL), but its seemed quite intricate 
> and I don't want to spend a week trying to figure something out that's far 
> from my reach.
>
> Any suggestions how to accomplish this?
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePH

Re: php requirements for 3.X

2016-03-18 Thread euromark
The requirement *is* a requirement.


Am Freitag, 18. März 2016 14:32:03 UTC+1 schrieb MikeK:
>
> Am migrating to 3.2 from cakephp 2.x, but my host only offers php 5.4 - I 
> saw the install requirements want 5.5.9
>
> Should I find another host or will 3.2 operate OK on 5.4?
>
> Thanks in advance and sorry if this is a dup - could not find an answer by 
> search.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how enable identifier quoting???

2016-03-14 Thread euromark
What part 
of https://github.com/cakephp/app/blob/master/config/app.default.php#L237-L245 
is not understandable?

Mark


Am Montag, 14. März 2016 04:34:29 UTC+1 schrieb Leonidas Savvides:
>
> *If you are using SQL keywords as table column names, you can enable 
> identifier quoting for your database connection in config/app.php.*
>
>
> How do this   
>
>
> long (for long, lat) is prohibited as db name of field...? if change to 
> long1 how apply the change in cakePHP? Also how * enable identifier 
> quoting???*
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp 2.x Receive emails into the application...

2016-03-13 Thread euromark
This might help you
https://github.com/barbushin/php-imap


Am Samstag, 12. März 2016 01:31:18 UTC+1 schrieb April DeRossett:
>
> Ahoy!  I am looking for a way to receive reply emails into my cakephp 
> application and after a ton of research I haven't yet figured out how to 
> make that happen.  Pretend I am an awesome PHP and MySQL programmer but, 
> that I know Nothing about managing an email server.  Does anyone know of a 
> great tutorial or read that would help me get started?  Thanks in advance. 
> April
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.x and Redis as one of the main Database

2016-02-21 Thread euromark
You could work together and upgrade it to 3.x.

Dont forget to publish it 
on https://github.com/FriendsOfCake/awesome-cakephp then.

Mark


Am Sonntag, 21. Februar 2016 15:06:29 UTC+1 schrieb web tools:
>
> Hello,
>
> I am new to CakePHP and I am wondering which is the best way to use Redis 
> not as Cache but as a main Database with CakePHP 3.x. 
>
> I have found a Plugin for Cake 2, but it seems to be incompatible with 
> CakePHP 3.x (https://github.com/Oefenweb/cakephp-redis).
>
> Does anyone has a tipp?
>
> Thanks, Cls
>

-- 
We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 location for API-Access

2016-02-21 Thread euromark
Take a look at twitter, and how they did it:
https://github.com/cvo-technologies/cakephp-twitter


Am Sonntag, 21. Februar 2016 15:06:29 UTC+1 schrieb web tools:
>
> Hello, 
>
> I would like to use the API of OpenWeatherMap (
> http://openweathermap.org/api) in my CakePHP 3.x Application, but I am 
> not sure where to put my API-Calls like "*getWeatherByCityname()*" in, 
> because '*Table*', '*Entity*' and '*Behaviour*' only belongs to 
> relational Databases.
>
> Is there a best practice?
>
> Thanks!
> cls
>
>
>

-- 
We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sorting paginated data by string length in cakephp 3.x

2016-02-09 Thread euromark
using 3.x virtual fields, expr() func() 
see the docs for that

Mark


Am Sonntag, 7. Februar 2016 17:48:33 UTC+1 schrieb jakubplus:
>
> Hi,
>
> I'd like to use Paginator sorting function, but for sorting by string 
> length like mysql LENGTH(title)
>
> $this->Paginator->sort('title')
>
> How to do that in cakephp 3?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Bug: flaws in email validation/sending

2016-01-31 Thread euromark
Please open a ticket at https://github.com/cakephp/cakephp/issues
This is just a discission board, not a bug tracker.

Mark


Am Samstag, 30. Januar 2016 05:33:10 UTC+1 schrieb Kim:
>
>
>- CakePHP's email validation allows non-ASCII letter characters, e.g. 
>á, in the  local part of the email address (by the \p{L} unicode category 
>construct). This should not be allowed, see 
>https://en.wikipedia.org/wiki/Email_address#Local_part.
>- It also allows non-ASCII letter characters in the domain part. This 
>allows Internationalized Domain Names (IDN). The problem here lies in the 
>fact that this is not supported by the SmtpTransport. An SMTP client 
> should 
>convert them to so called punycode ASCII, according to 
>https://lists.exim.org/lurker/message/20140812.120609.bf764769.en.html. 
>MTA exim does not accept the SMTP sequence. By the way, conversion to 
>punycode can be done by PHP's idn_to_ascii().
>
> This issues have been tested in the current 2.7 branch, but a quick code 
> inspection confirms that they are also present in the master branch. As a 
> workaround I have switched back to validation by PHP's filter_var(), used 
> in a wrapper validation method.
>
> The first issue can be fixed easily, although the right RFCs have to be 
> consulted. For the second issue, we have to decide if we support IDN for 
> email and if we do, support it (maybe not only in the SmtpTransport).
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: ajax pagination

2016-01-07 Thread euromark
See http://sandbox3.dereuromark.de/sandbox/ajax-examples

Mark


Am Dienstag, 5. Januar 2016 10:21:29 UTC+1 schrieb Kamlesh Gupta:
>
> Hello,
>
> I am facing a problem of pagination in cakephp 3.14..
>
> How can we make a ajax pagination in cakephp 3.1.4
>
> would anyone please help me.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Shell arguments and options

2015-12-22 Thread euromark
See the existing core shells for details.
They use it quite a bit.

Tip: ConsoleOptionParser

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Martina Weinzettelova:
>
> Hello
>
> I cant find in docummentation how can i access passed argumet and options 
> in shell function.
>
> bin/cake myshell function --option value
>
> How can i read --option ???
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to unset field value of a post edit view

2015-12-22 Thread euromark
You need to be more specific.
Also, your forms should always preserve the correct state on post, and 
should preset on get with DB values etc.

Failing to do so will get you in trouble.
Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Amit Gora:
>
> i am using checkbox array in my form and save their values "," separated 
> in database. so when i go into edit view of this post then it`s get default 
> value of field which is set by controller so i want to disable it for some 
> fields. how i can do it??
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: how to connect a simple registration form with mysql

2015-12-22 Thread euromark
Please see the tutorials in the docs.

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb kumar pkvel:
>
> i want to connect a registration form am a beginner  i need to connect in 
> xampp cake php version3.1.2
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to delete first record using postLink()

2015-12-22 Thread euromark
You already answer yourself: Forms in forms is invalid.
The docs tell you what to do, use a block to capture the forms of the 
postLink() and output it after you closed the form.

Mark


Am Dienstag, 22. Dezember 2015 11:39:13 UTC+1 schrieb Jaspreet Sarao:
>
> Hello, I am new to cakephp..
>
> I have used postLink() to delete the records. On a page, I am unable to 
> delete first record using postLink(). I have used postLink() after 
> $this->Form->create.
>
> 
> $this->Form->postLink($image1, array(
> 'action' => 'delete',
> $item[$modelClass]['id'],
> ), array('escape' => false), __('Are you sure?'));
>
> 
>
> Can anybody help me?
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is the automatic direction change broken in the paginator for the latest Cake 3 release?

2015-12-11 Thread euromark
What "is" your latest cake3 release?
Are you referring to 3.0 or 3.1?

I highly doubt that, there are tests for this behavior.
Are there any links outputted at all?
What do they say?
You need to be more exact in your statements, or it is hard to say anything 
here.

mark



Am Freitag, 11. Dezember 2015 12:09:45 UTC+1 schrieb heavyKevy:
>
> my index method has the following baked code.
> $this->paginate = [
> 'contain' => ['Users', 'Heights', 'Weights', 'Bats', 'Throws', 
> 'PrimaryPositions', 'SecondaryPositions']
> ];
> $this->set ( 'players', $this->paginate ( $this->Players ) );
>
> And my index.ctp is the standard baked template with the following sort 
> link:
>   Paginator->sort('username') ?>
>
> According to the documentation, if I click the title Username, it should 
> default to ASC, then Alternate between ASC and DESC.
> Mine never alternates...
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp 2.5 cron jobs

2015-11-27 Thread euromark
Maybe you can, but you probably shouldn't
the call as documented definitly works.

Just make sure you got permissions (+x) for the console cake file!

Mark


Am Mittwoch, 25. November 2015 14:01:00 UTC+1 schrieb Igor Padovan da Silva:
>
> You can use the */full/path/to/Console/cake -app /full/path/to/app 
> your_shell *
>
> 2015-11-21 4:40 GMT-03:00 Ruslan >:
>
>> Hi,
>> The first of all, Did you try copy-paste your command in terminal? ( /
>> path/to/app/ && Console/cake your_shell_name params).  Do you see ant 
>> errors? show it here.  Check users rights
>> I think you have issue (or will have second issue :) ) with permissions 
>> for tmp/cashe. Don't forget, you run cron as user ( user_name ), and may be 
>> you use web app too (web app runs with user's rights  for web server ( www, 
>> or httpd  ) ) and by default each time when you run app you get temporary 
>> files with different permissions.
>>
>>
>>  
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Igor Padovan da Silva
> about.me/igorpadovan
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 404 requests filling view cache

2015-10-28 Thread euromark
Yes, in 2.4+ there is a skipLog param:
http://book.cakephp.org/2.0/en/appendices/2-4-migration-guide.html#errorhandler

But I just log them to a different log file via custom handler:
See 
https://github.com/dereuromark/cakephp-tools/wiki/Included-fixes-and-migration-tweaks#bugfixes--useful-adjustments
and 
https://github.com/dereuromark/cakephp-tools/blob/master/src/Error/ErrorHandler.php
 
.

Mark



Am Mittwoch, 28. Oktober 2015 01:34:43 UTC+1 schrieb cricket:
>
> Cake 2.2.4 (Yeah, i know -- need to upgrade this site!)
>
> I just noticed that the view cache dir has a bunch of files along the 
> lines of:
>
>
> s_2fabc_2fabc_2fabc_2f_24_7b_40print_28md5_28base64_decode_28mzywd2vic2nhbg_29_29_29_7d_2f.php
>
> Looks like the work of script kiddies. However, I'm also seeing things 
> like this:
>
> articles_deep_denial_or_disinformation.php
> articles_dee.php
>
> The first is the correct name/path and the second one is incomplete. There 
> are several examples of this. I dunno if it's a Cake issue or not but the 
> latter really shouldn't be cached as it's a 404.
>
> Is there some way to tell Cake *not* to cache these?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cake3, rss helper and cdata

2015-10-07 Thread euromark
I think the Rss helper should not be used for rss anymore, its a little bit 
outdated approach and has some flaws.
Check the Feed plugin repo and its RssView class ( 
https://github.com/dereuromark/cakephp-feed ) as well as
http://www.dereuromark.de/2013/10/03/rss-feeds-in-cakephp/

Mark


Am Dienstag, 6. Oktober 2015 11:36:23 UTC+2 schrieb lorenzoshake:
>
> How to display cdata with rss helper ?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: if($this->Auth->login($this->request->data)) Return true with right or wrong password and iden

2015-09-21 Thread euromark
Read the documentation.
You are never supposed to pass anything to login() in this case.

mark


Am Samstag, 19. September 2015 22:11:47 UTC+2 schrieb abdessamad kassasse:
>
> i will show my code
> utilisateurcontroller
> public function login()
> {
> debug($this->Session->read());
> if($this->request->is('post'))
> {
> print_r($this->request->data);
> if($this->Auth->login($this->request->data))
> { 
> debug($this->Auth->login($this->request->data)); 
> debug($this->Auth->user()); 
> echo "**";
> //return $this->redirect($this->Auth->redirectUrl());
> }
> else{
>
> echo 
> "";
> $this->Session->setFlash(__('Invalid name_U or password'));
>
> }
> }
> 
> /*if ($this->Session->read('Auth.Utilisateur')) {
> $this->Session->setFlash('Vous êtes connecté!');
> return $this->redirect('/');
> echo $this->Session->flash('auth');
> }*/
>
> }
> public function logout()
> {
> $this->Auth->logout();
>  $this->Session->destroy();
> $this->redirect('/clients/index');
> }
>
> -
> model
>  App::uses('AppModel', 'Model');
> /**
>  * Utilisateur Model
>  *
>  * @property Group $Group
>  */
> App::uses('AuthComponent', 'Controller/Component');
> class Utilisateur extends AppModel {
>
> /**
>  * Display field
>  *
>  * @var string
>  */
> public $displayField = 'id';
>
>
> //The Associations below have been created with all possible keys, 
> those that are not needed can be removed
>
> /**
>  * belongsTo associations
>  *
>  * @var array
>  */
> public $belongsTo = array(
> 'Group' => array(
> 'className' => 'Group',
> 'foreignKey' => 'group_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> )
> );
>
>
> public $actsAs = array('Acl' => array('type' => 'requester', 'enabled' 
> => false));
>
> public function parentNode() {
> if (!$this->id && empty($this->data)) {
> return null;
> }
> if (isset($this->data['Utilisateur']['group_id'])) {
> $groupId = $this->data['Utilisateur']['group_id'];
> } else {
> $groupId = $this->field('group_id');
> }
> if (!$groupId) {
> return null;
> }
> return array('Group' => array('id' => $groupId));
> }
> public function beforeSave($options = array()) {
> $this->data['Utilisateur']['password'] = 
> AuthComponent::password($this->data['Utilisateur']['password']);
> return true;
> }
> public function bindNode($utilisateur) {
>
> return array('model' => 'Group', 'foreign_key' => 
> $utilisateur['Utilisateur']['group_id']);
> }
>
> }
>
> -
> app controller
>  /**
>  * Application level Controller
>  *
>  * This file is application-wide controller file. You can put all
>  * application-wide controller-related methods here.
>  *
>  * @link  http://cakephp.org CakePHP(tm) Project
>  * @package   app.Controller
>  * @since CakePHP(tm) v 0.2.9
>  */
>
> App::uses('Controller', 'Controller');
>
> /**
>  * Application Controller
>  *
>  * Add your application-wide methods in the class below, your controllers
>  * will inherit them.
>  *
>  * @packageapp.Controller
>  * @link
> http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
>  */
> class AppController extends Controller {
> public $helpers =array('Html','Form','Session');
>
> public $components = array('Session','Acl',
> 'Auth' => array(
> 'authorize' => array(
> 'Actions' => array('actionPath' => 'controllers',
>   'userModel' => 'Utilisateur'),
> 
> 'authenticate'=>array('Form'=>array('fields'=>array('username'=>'name_U','password'=>'password')))
>  
> )
>
>
>)
>   
> 
>  );
>
>  public function beforeFilter() {
>  $this->Auth->allow('display');
>  $this->Auth->userModel = 'Utilisateur';
> 
>
>$this->Auth->loginAction = array(
>   'controller' => 'Utilisateurs',
>   'action' => 'login'
> );
> $this->Auth->logoutRedirect = array(
>   'controller' => 'Utilisateurs',
>   'action' => 'login'
> );
>   /*  $this->Auth->loginRedirect = array(
>   'controller' => 'Utilisateurs',
>   'action' => 'add'
> );*/
> $this->Auth->

Re: How to run multiple development cakephp projects on the same cake server?

2015-08-18 Thread euromark
Just use virtual hosts and you can run infinite projects on the same one, 
either per domain or per subdomain :)
I never use localhost directly ;)

See http://www.dereuromark.de/2011/05/29/working-with-domains-locally/ for 
example.

Mark


Am Montag, 17. August 2015 09:40:28 UTC+2 schrieb Raul Magdalena Catala:
>
> How can i run multiple development cakephp projects on the same cake 
> server and access them via http://localhost:8765 ? 
>
> is this possible ?
>
> thanks in advance
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Component

2015-07-20 Thread euromark
You can also keep things skinny by leveraging components here maybe.

Am Samstag, 18. Juli 2015 13:21:20 UTC+2 schrieb Jeremy Burns:
>
> Yup - I understand that. But a method in a skinny controller (which I 
> appreciate is the element that should provide feedback on progress) hands 
> off to a single model function which then follows business rules and runs a 
> series of processes in sequence. So my question is “when the progress one 
> wants to track is within the model layer, how does one expose that to the 
> controller layer”?
>
> On 18 Jul 2015, at 11:56, euromark > 
> wrote:
>
> multi-step sounds like the C in MVC. the model itself has nothing to do 
> with stateful requests IMO.
>
> Am Freitag, 17. Juli 2015 11:08:21 UTC+2 schrieb Jeremy Burns:
>>
>> What about the situation where you have a multi-step process inside a 
>> model/s and you want to make the progress status available to javascript 
>> calls?
>>
>> On 17 Jul 2015, at 09:55, euromark  wrote:
>>
>> Your models should stay stateless, as such you should never internally 
>> use the session.
>> Instead, pass the data to the model layer or use events to pass them
>>
>> Use https://github.com/UseMuffin/Footprint
>>
>> Mark
>>
>>
>> Am Donnerstag, 16. Juli 2015 23:03:45 UTC+2 schrieb Rafael Queiroz:
>>>
>>> Hi guys,
>>>
>>> I need loaded components in my Models, actually Auth Component, for 
>>> store user id logged. In old version, CakePHP 2.x, i using in my model:
>>>
>>> App::uses('AuthComponent', 'Controller/Component');
>>>
>>> public function beforeSave() {
>>> if (!$this->id) {
>>> $this->data[$this->alias]['user_id'] = AuthComponent::user('id');
>>> }
>>> }
>>>
>>> It's possible in Cake 3 ?
>>>
>>> -- 
>>> Atenciosamente,
>>>
>>> Rafael F. Queiroz
>>>  
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com.
>> To post to this group, send email to cake...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Component

2015-07-18 Thread euromark
multi-step sounds like the C in MVC. the model itself has nothing to do 
with stateful requests IMO.

Am Freitag, 17. Juli 2015 11:08:21 UTC+2 schrieb Jeremy Burns:
>
> What about the situation where you have a multi-step process inside a 
> model/s and you want to make the progress status available to javascript 
> calls?
>
> On 17 Jul 2015, at 09:55, euromark > 
> wrote:
>
> Your models should stay stateless, as such you should never internally use 
> the session.
> Instead, pass the data to the model layer or use events to pass them
>
> Use https://github.com/UseMuffin/Footprint
>
> Mark
>
>
> Am Donnerstag, 16. Juli 2015 23:03:45 UTC+2 schrieb Rafael Queiroz:
>>
>> Hi guys,
>>
>> I need loaded components in my Models, actually Auth Component, for store 
>> user id logged. In old version, CakePHP 2.x, i using in my model:
>>
>> App::uses('AuthComponent', 'Controller/Component');
>>
>> public function beforeSave() {
>> if (!$this->id) {
>> $this->data[$this->alias]['user_id'] = AuthComponent::user('id');
>> }
>> }
>>
>> It's possible in Cake 3 ?
>>
>> -- 
>> Atenciosamente,
>>
>> Rafael F. Queiroz
>>  
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Component

2015-07-17 Thread euromark
Your models should stay stateless, as such you should never internally use 
the session.
Instead, pass the data to the model layer or use events to pass them

Use https://github.com/UseMuffin/Footprint

Mark


Am Donnerstag, 16. Juli 2015 23:03:45 UTC+2 schrieb Rafael Queiroz:
>
> Hi guys,
>
> I need loaded components in my Models, actually Auth Component, for store 
> user id logged. In old version, CakePHP 2.x, i using in my model:
>
> App::uses('AuthComponent', 'Controller/Component');
>
> public function beforeSave() {
> if (!$this->id) {
> $this->data[$this->alias]['user_id'] = AuthComponent::user('id');
> }
> }
>
> It's possible in Cake 3 ?
>
> -- 
> Atenciosamente,
>
> Rafael F. Queiroz
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Composer and Cake lib folder

2015-07-16 Thread euromark
yes and yes
the additional files don't hurt :)


Am Dienstag, 14. Juli 2015 17:13:31 UTC+2 schrieb brett.shi...@gmail.com:
>
> Ok, that example clears up my confusion.  Basically when cake is 
> "required" within the composer file, it gets downloaded to the Vendor 
> folder.
>
> I then need to edit my app/webroot/index.php to point to the Cake core lib 
> folder in /Vendor/cakephp/.  Is that correct?
>
> Also, I noticed composer also downloaded the app folder structure into the 
> Vendor.  I am assuming that is just how it is and you can't just download 
> the required core/lib Cake folders?
>
> On Monday, July 13, 2015 at 8:10:52 AM UTC-7, euromark wrote:
>>
>> That is actually how you are *supposed* to do it.
>> the vendors including the cake core should never be commited and tracked.
>>
>> See https://github.com/dereuromark/cakefest for an example 
>> implementation (both 2.x and 3.x composered).
>>
>> mark
>>
>>
>>
>> Am Sonntag, 12. Juli 2015 13:23:06 UTC+2 schrieb brett.shi...@gmail.com:
>>>
>>> I have a standard Cake project setup on Github.  The project root for 
>>> has the app, lib folders in addition to all the other files like 
>>> .gitignore.  I would like to remove the lib folder from my repo and control 
>>> which Cake version I am using with a dependency manager.  Is this possible 
>>> with composer? 
>>>
>>> For example, I could just change the composer json file from Cake 2.4 to 
>>> 2.6, and the repo will not have to track the lib folder.  Then when I want 
>>> to put the project online, I can just have composer download the lib 
>>> folder. 
>>>
>>> Is this possible?  What would that composer file look like?  I tried 
>>> adding "cakephp/cakephp": "~2.6" to the composer file but it gives and 
>>> error saying the package could not be found.
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Composer and Cake lib folder

2015-07-13 Thread euromark
That is actually how you are *supposed* to do it.
the vendors including the cake core should never be commited and tracked.

See https://github.com/dereuromark/cakefest for an example implementation 
(both 2.x and 3.x composered).

mark



Am Sonntag, 12. Juli 2015 13:23:06 UTC+2 schrieb brett.shi...@gmail.com:
>
> I have a standard Cake project setup on Github.  The project root for has 
> the app, lib folders in addition to all the other files like .gitignore.  I 
> would like to remove the lib folder from my repo and control which Cake 
> version I am using with a dependency manager.  Is this possible with 
> composer? 
>
> For example, I could just change the composer json file from Cake 2.4 to 
> 2.6, and the repo will not have to track the lib folder.  Then when I want 
> to put the project online, I can just have composer download the lib 
> folder. 
>
> Is this possible?  What would that composer file look like?  I tried 
> adding "cakephp/cakephp": "~2.6" to the composer file but it gives and 
> error saying the package could not be found.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp ajax pagination

2015-07-13 Thread euromark
There are many different (and easy ways),
IMO the best way would be one that also allows a fallback (non js in case 
js is broken or for google bot etc)
see http://sandbox3.dereuromark.de/sandbox/ajax-examples/pagination for an 
example in cake3.

mark


Am Sonntag, 12. Juli 2015 13:23:07 UTC+2 schrieb Daniel Uche:
>
> I am trying to do an ajax pagination in cakephp 3.0 but for some reason i 
> can't get around it
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: noisy logs

2015-07-10 Thread euromark
You should always mention the exact cakephp version you are using.


Am Freitag, 10. Juli 2015 02:17:35 UTC+2 schrieb . .:
>
> Is there a way to split the NotFoundException to another log file? Instead 
> of error.log, it should go to, for example, notfoundexception.log file. 
>
> Thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Result of function search is very large

2015-06-29 Thread euromark
Looks to me as if you could have done the same thing properly (not using 
session but PRG pattern) and with 3 lines of code
using https://github.com/CakeDC/search

mark



Am Montag, 29. Juni 2015 10:30:50 UTC+2 schrieb Eb ook:
>
> Hello all,
>
> Result of function search is very large, It sometime is wrong.
>
> Can you help me to fix it.
>
> This is source this function.
>
> public function find(){
> $this->layout = 'listimage';
> $this->set('title_for_layout', __('Search Results', true));
> $this->Image->recursive = 0;
> $search = $this->Session->read('Search');
> if(!empty($_POST['data'])){
> $this->Session->write('Search', $this->data);
> $conditions = array();
>   if($this->Session->read('Search.Image.region_id')){
> $q = $this->Session->read('Search.Image.region_id');
> $conditions['Image.region_id'] = $q;
> }
>   if($this->Session->read('Search.Image.artist_id')){
> $q = $this->Session->read('Search.Image.artist_id');
> $conditions['Image.artist_id'] = $q;
>   }
>   if($this->Session->read('Search.Image.movement_id')){
> $q = $this->Session->read('Search.Image.movement_id');
> $conditions['Image.movement_id'] = $q;
>   }
>   if($this->Session->read('Search.Image.museum_id')){
> $q = $this->Session->read('Search.Image.museum_id');
> $conditions['Image.museum_id'] = $q;
>   }
>   if($this->Session->read('Search.Image.museum_id')){
> $q = $this->Session->read('Search.Image.museum_id');
> $conditions['Image.museum_id'] = $q;
>   }
>   if($this->Session->read('Search.Theme.Theme.0')){
> $q = $this->Session->read('Search.Theme.Theme.0');
> $this->Image->bindModel(array('hasOne' => 
> array('ImagesTheme')),false);
> $conditions['ImagesTheme.theme_id']= $q;
>   }
>   if($this->Session->read('Search.Media.Media.0')){
> $q = $this->Session->read('Search.Media.Media.0');
> $this->Image->bindModel(array('hasOne' => 
> array('ImagesMedium')),false);
> $conditions['ImagesMedium.media_id']= $q;
>   } 
>   if($this->Session->read('Search.Image.start_year')){
> if($this->Session->read('Search.Image.end_year')){
> $q = $this->Session->read('Search.Image.start_year');
> $p = $this->Session->read('Search.Image.end_year');
> if($this->Session->read('Search.Image.BC_start'))
> $conditions['Image.start_year <='] = $q;
> else
> $conditions['Image.start_year >='] = $q;
> if($this->Session->read('Search.Image.BC_end'))
> $conditions['Image.end_year >='] = $p;
> else
> $conditions['Image.end_year <='] = $p;
> }
> else {
> $q = $this->Session->read('Search.Image.start_year');
> $conditions['Image.start_year ='] = $q;
> }
>   }
>   if($this->Session->read('Search.Image.end_year')){
> if($this->Session->read('Search.Image.start_year')){
> $q = $this->Session->read('Search.Image.end_year');
> $p = $this->Session->read('Search.Image.start_year');
> if($this->Session->read('Search.Image.BC_start'))
> $conditions['Image.start_year <='] = $p;
> else
> $conditions['Image.start_year >='] = $p;
> if($this->Session->read('Search.Image.BC_end'))
> $conditions['Image.end_year >='] = $q;
> else
> $conditions['Image.end_year <='] = $q;
> }
> else {
> $q = $this->Session->read('Search.Image.end_year');
> $conditions['Image.end_year ='] = $q;
> }
>   }
>   $search = $this->Session->read('Search.Image.q');
>   $newconditions = array();
> if($search) {
> setlocale(LC_ALL, "en_US.utf8");
> $search = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', 
> $search);
> //$search = preg_replace('/[^a-zA-Z0-9]/', '_', $search);
> //$search = '"'.$search.'"';
> if(strpos($search, '"')!==false){
>   $search = str_replace('"','-',$search);
>   }elseif(strpos($search, '+')!==false){
>   $search = str_replace('+','-',$search);
> 

Re: cakephp search

2015-06-18 Thread euromark
You need to be more precise.
Mark


Am Donnerstag, 18. Juni 2015 10:17:17 UTC+2 schrieb SURYA PANDEY:
>
> *how to create search system using database in cake php.. plz suggest 
> me*
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Would you please give me great explaination below what i have mentioned concepts?

2015-06-15 Thread euromark
It is all explained in the docs:
http://book.cakephp.org/3.0/en/orm/saving-data.html#namespace-Cake\ORM


Am Freitag, 12. Juni 2015 07:27:43 UTC+2 schrieb Gowthaman Suriya:
>
> Hi developer, 
>
> I am stumped with these things are such as newEntity(), element(), 
> patchEntity(), set()?.
>
> If you know about these things very well let you give me a great 
> explanation. 
>
>
> Thanks in advance. 
>
> Regards
> Gowthaman
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Advise plugin to compress CSS and JS for cakephp 3.x

2015-06-11 Thread euromark
https://github.com/FriendsOfCake/awesome-cakephp#asset-management

Am Mittwoch, 10. Juni 2015 19:40:13 UTC+2 schrieb InYan:
>
> Advise plugin to compress CSS and JS for cakephp 3.x. 
> In the old version of the framework I've used CakePHP-Combinator-Plugin 
> 
> But with cakephp 3.x it does not work.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Special table/column name

2015-06-08 Thread euromark
In the conventions section of the docs I bet.
name or title gets autoselected for the displayField.


Am Sonntag, 7. Juni 2015 21:33:23 UTC+2 schrieb Leo Wong:
>
> Hi,
>
> It seems there are some special table/column name will have advantage for 
> cakephp, like the column "name" will be show rather than id. Th username 
> and password also.
>
> My question is, where can I found the information about the special name ?
>
> Thank you.
>
> Leo   
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Migrations cake v.1.3 -> v.3.x

2015-06-05 Thread euromark
Basically

$sql = $this->schema()->truncateSql($this->_connection);
foreach ($sql as $snippet) {
$this->_connection->execute($snippet);
}


Am Freitag, 5. Juni 2015 12:15:01 UTC+2 schrieb euromark:
>
> This is all you need in your Table:
>
> https://github.com/dereuromark/cakephp-tools/blob/cake3/src/Model/Table/Table.php#L132
>
>
> Am Freitag, 5. Juni 2015 09:16:44 UTC+2 schrieb InYan:
>>
>>
>> <https://lh3.googleusercontent.com/-2nzlMXaom3g/VXFLwLPOOjI/AQ0/3d473WJBcPo/s1600/qq.jpg>
>> Please suggest if there is an analogue of cakephp3
>>  --
>> Continuing this question, please tell how to cakephp3 implement such a 
>> code: $this->Model->query("TRUNCATE TABLE models;")
>> I found such a code, but how to use it - do not know 
>> http://api.cakephp.org/3.0/source-class-Cake.Database.Schema.BaseSchema.html#_truncateTableSql
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Migrations cake v.1.3 -> v.3.x

2015-06-05 Thread euromark
This is all you need in your Table:
https://github.com/dereuromark/cakephp-tools/blob/cake3/src/Model/Table/Table.php#L132


Am Freitag, 5. Juni 2015 09:16:44 UTC+2 schrieb InYan:
>
>
> 
> Please suggest if there is an analogue of cakephp3
>  --
> Continuing this question, please tell how to cakephp3 implement such a 
> code: $this->Model->query("TRUNCATE TABLE models;")
> I found such a code, but how to use it - do not know 
> http://api.cakephp.org/3.0/source-class-Cake.Database.Schema.BaseSchema.html#_truncateTableSql
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: I need some help with CakeDC Search

2015-06-01 Thread euromark
See http://sandbox3.dereuromark.de/sandbox/search-examples and the code to 
it for example.


Am Sonntag, 31. Mai 2015 23:39:15 UTC+2 schrieb Jekill CR:
>
>
> *I need some help with CakeDC Search i configured the plugin with the 
> instructions and nothing happens.*
>
> Only show the text of the search on the Web Browser search input.
>
> Please if someone have a working configuration and can share with me.
>
> thanks in advance!
>
>
> I need the most simple configuration nothing special.
>
> Sorry for my bad english.
>
> Jesus Castro - Costa Rica 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to use Plugins in CakePHP 2.6..??

2015-06-01 Thread euromark
http://book.cakephp.org/2.0/en/plugins.html


Am Sonntag, 31. Mai 2015 23:39:15 UTC+2 schrieb Solomon Gebreslasie:
>
> Hello there,
>
> My name is Solomon G. I am making E-commerce website for a friend and I 
> was wondering if some one could tell me how to use cakePHP Plugins..??  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Forgot password in cakephp 3.0

2015-05-30 Thread euromark
See 
https://github.com/dereuromark/cakefest/blob/3.0/src/Controller/AccountController.php#L82
 
for an example



Am Dienstag, 26. Mai 2015 14:39:33 UTC+2 schrieb Karthik Keyan:
>
> Hi, 
> How we set the validation for the forgot password. Password can be 
> send to email *please send the functionality of forgot password*
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to set Authorization wise view in the Form in CakePHP-3.0

2015-05-28 Thread euromark
check() and comparison is really a bad idea
the first returns bool, how should that ever === to a string?
wrapping that with !empty() makes this completely wrong

if(!empty($this->request->session()->check('Auth.User.role') === 'superadmin')){



Try

if ($this->request->session()->read('Auth.User.role') === 'superadmin') {}

instead


Am Donnerstag, 28. Mai 2015 15:54:47 UTC+2 schrieb Bayezid Alam:
>
> Hi All,
>
> I want to set an authorization in the registration of a form using CakePHP 
> 3.0.
>
> Before asking here, i tried below things but no luck in my favor.
>
> Suppose i have role field in the usersTable like 'superuser', 'admin', 
> 'user'.
>
> I want to provide permission superuser to make all the things like create 
> admin and user. and then admin can create admin and user, and user can make 
> user only.
>
> The code i tried in the add function of UsersController.
>
> if($this->Auth->user['role'] === 'superuser'){
> $roles = $this->Users->find('list');
> } elseif ($this->Auth->user['role'] === 'admin') {
> $roles = $this->Users->find('list')->where(['Users.role !==' => 
> 'superuser']);
> } else {
> $roles = $this->Users->find('list')->where(['Users.role' => 'user']);
> }
>
> after failing i tried below things in the add.ctp
>
> if(!empty($this->request->session()->check('Auth.User.role') === 
> 'superadmin')){
> echo $this->Form->input('role',['options' => ['admin' => 'Admin', 
> 'user' => 'User']]);
> } elseif(!empty($this->request->session()->check('Auth.User.role') 
> === 'admin')){
> echo $this->Form->input('role',['options' => ['user' => 'User', 
> 'icr' => 'ICR', 'routing' => 'Routing']]);
> } else {
> echo $this->Form->input('role', ['options' => ['user' => 
> 'User']]);
> }
>
> Could you please suggest on this regard or are there any easiest ways to 
> do so?
>
>
> http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0
>
> Thanks
>
> Bayezid
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Migrate from Cake 2.x

2015-05-25 Thread euromark
Let me know what you came up with
We should add this to the https://github.com/dereuromark/cakephp-shim 
plugin to ease migration of those forms from 2.x to 3.x in general.
The IDs generated in 3.x are too collision-likely for me too.

Mark


Am Mittwoch, 20. Mai 2015 13:39:35 UTC+2 schrieb gersonfs:
>
> Hello!
>
> Is there a way to use the input id attribute from CakePHP 2 in CakePHP 3? 
> Like define a custom method for generate id attribute value? Or better yet, 
> use the FormHelper 2.x version of CakePHP.
>
> CakePHP 3 break all my javascript files based on id attribute. I did not 
> see any observations on this change in migration guide at the Form Helper 
> session.
>
> I use CakePHP since the 0.x version, over 200 projects done, and never an 
> update has been so problematic. I hope this does not happen in the next 
> major releases.
>
> I completely understand that our ORM was outdated and it needed an upgrade 
> facing OO. It's also great to have PHP 5.4 features. Although updates have 
> affected 99% of my code: models and forms/javascript.
>
> Thanks!
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp 3.0 saveField

2015-04-03 Thread euromark
Just use save()?


Am Freitag, 3. April 2015 00:05:12 UTC+2 schrieb DiV:
>
> How can I update a single field if I know record's id without retrieving a 
> row?
> There was a method saveField for this action in cakephp 2.x
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Notice (8): Undefined variable: color [APP/Template\Pages\myshow.ctp, line 2]

2015-04-02 Thread euromark
Hi!
Why are you abusing the pages controller for that?
It doesn't support actions out of the box.

Make yourself a new FooController and then you can have actions for your 
views.
But the PagesController itself only supports view files only (no action for 
it)
The error you get shows this pretty clearly

Mark


Am Donnerstag, 2. April 2015 16:40:17 UTC+2 schrieb Amit G:
>
> Hi,
>
> I am using CakePHP3.0 getting 
>
> *Notice* (8): Undefined variable: color [*APP/Template\Pages\myshow.ctp*, 
> line *2*]
> how can fix this error?
>
> Here is my full code:
>
>  namespace App\Controller;
>
> use Cake\Core\Configure;
> use Cake\Network\Exception\NotFoundException;
> use Cake\View\Exception\MissingTemplateException;
> class PagesController extends AppController
> {
>
> /**
>  * Displays a view
>  *
>  * @return void|\Cake\Network\Response
>  * @throws \Cake\Network\Exception\NotFoundException When the view file 
> could not
>  *   be found or \Cake\View\Exception\MissingTemplateException in debug 
> mode.
>  */
> public function display()
> {
> $path = func_get_args();
>
> $count = count($path);
> if (!$count) {
> return $this->redirect('/');
> }
> $page = $subpage = null;
>
> if (!empty($path[0])) {
> $page = $path[0];
> }
> if (!empty($path[1])) {
> $subpage = $path[1];
> }
> $this->set(compact('page', 'subpage'));
>
> try {
> $this->render(implode('/', $path));
> } catch (MissingTemplateException $e) {
> if (Configure::read('debug')) {
> throw $e;
> }
> throw new NotFoundException();
> }
> }
>   
> public function myshow() {
> $this->set('color', 'pink');
>
>   $this->render();
> }
> }
>
>
>
>
> src\Template\Pages\myshow.ctp
>
>  echo $color;
>
> ?>
> test
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-30 Thread euromark
no, patchEntity is what it is: it patches data into the entity
that is necessary for ALL forms, so both add and edit ones of course.


Am Sonntag, 29. März 2015 21:15:28 UTC+2 schrieb Dave Edwards:
>
> Why has the first method (which is the correct one) got both 
>
> $this->Articles->newEntity()
>
> and
>
>  $this->Articles->patchEntity()
>
> when you are saving a new record?
>
> I thought that newEntity was used when inserting new data, and patchEntity 
> was for updating existing data? Is my understanding incorrect?
>
> Dave
>
> On Friday, 27 March 2015 21:24:38 UTC, euromark wrote:
>
> The latter is deprecated, this changed during RC and as such the tutorial 
> needs some updating.
> Thats all there is to it :)
>
> Mark
>
>
> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>
> Hi,
>
> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>
> As example given on below link's in the add function.
>
> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/part-two.html#adding-articles
>
> public function add()
> {
> $article = $this->Articles->newEntity(); // *A blank newEnttity added 
> stored in $article variable*
> if ($this->request->is('post')) {
> $article = $this->Articles->patchEntity($article, 
> $this->request->data); // *A patchEntity added here & passed the request data 
> here*
> if ($this->Articles->save($article)) {
> $this->Flash->success(__('Your article has been saved.'));
> return $this->redirect(['action' => 'index']);
> }
> $this->Flash->error(__('Unable to add your article.'));
> }
> $this->set('article', $article);
> }
>
>
>
> But i found a different things on below link
>
> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog-auth-example/auth.html#creating-all-user-related-code
>
> public function add()
> {
> $user = $this->Users->newEntity($this->request->data); // *request 
> data passing through newEntity here*
> if ($this->request->is('post')) {
> if ($this->Users->save($user)) {
> $this->Flash->success(__('The user has been saved.'
>
> ...

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-28 Thread euromark
It would be cool if you could PR the corrections so that others don't trip 
over it, too.

mark


Am Samstag, 28. März 2015 10:35:52 UTC+1 schrieb Bayezid Alam:
>
> Ok, Thanks for reply.. :)
>
> On Sat, Mar 28, 2015 at 3:24 AM, euromark  > wrote:
>
> The latter is deprecated, this changed during RC and as such the tutorial 
> needs some updating.
> Thats all there is to it :)
>
> Mark
>
>
> Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>
> Hi,
>
> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>
> As example given on below link's in the add function.
> http://book.cakephp.org/3.0/en/tutorials-and-examples/
> blog/part-two.html#adding-articles
>
> public function add()
> {
> $article = $this->Articles->newEntity(); // *A blank newEnttity added 
> stored in $article variable*
> if ($this->request->is('post')) {
> $article = $this->Articles->patchEntity($article, 
> $this->request->data); // *A patchEntity added here & passed the request data 
> here*
> if ($this->Articles->save($article)) {
> $this->Flash->success(__('Your article has been saved.'));
> return $this->redirect(['action' => 'index']);
> }
> $this->Flash->error(__('Unable to add your article.'));
> }
> $this->set('article', $article);
> }
>
>
>
> But i found a different things on below link
> http://book.cakephp.org/3.0/en/tutorials-and-examples/
> blog-auth-example/auth.html#creating-all-user-related-code
>
> public function add()
> {
> $user = $this->Users->newEntity($this->request->data); // *request 
> data passing through newEntity here*
> if ($this->request->is('post')) {
> if ($this->Users->save($user)) {
> $this->Flash->success(__('The user has been saved.'));
> return $this->redirect(['action' => 'add']);
> }
> $this->
>
> ...
>
>  -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, 
>
> ...

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0 - Confusion comes from

2015-03-27 Thread euromark
The latter is deprecated, this changed during RC and as such the tutorial 
needs some updating.
Thats all there is to it :)

Mark


Am Freitag, 27. März 2015 15:37:26 UTC+1 schrieb Bayezid Alam:
>
> Hi,
>
> A confusion comes on my mind regarding the adding something on CakePHP 3.0
>
> As example given on below link's in the add function.
>
> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/part-two.html#adding-articles
>
> public function add()
> {
> $article = $this->Articles->newEntity(); // *A blank newEnttity added 
> stored in $article variable*
> if ($this->request->is('post')) {
> $article = $this->Articles->patchEntity($article, 
> $this->request->data); // *A patchEntity added here & passed the request data 
> here*
> if ($this->Articles->save($article)) {
> $this->Flash->success(__('Your article has been saved.'));
> return $this->redirect(['action' => 'index']);
> }
> $this->Flash->error(__('Unable to add your article.'));
> }
> $this->set('article', $article);
> }
>
>
>
> But i found a different things on below link
>
> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog-auth-example/auth.html#creating-all-user-related-code
>
> public function add()
> {
> $user = $this->Users->newEntity($this->request->data); // *request 
> data passing through newEntity here*
> if ($this->request->is('post')) {
> if ($this->Users->save($user)) {
> $this->Flash->success(__('The user has been saved.'));
> return $this->redirect(['action' => 'add']);
> }
> $this->
>
> ...

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Advice for a newbie?

2015-03-22 Thread euromark
Since weeks there is only one real option: Cake3 :)
Use this version right away, as a bonus it just became stable as of today

enjoy
Happy Baking
Mark


Am Sonntag, 22. März 2015 13:37:30 UTC+1 schrieb Jim_1993z:
>
> Hello,
>
> I am an occasional database programmer, going way back to dBase days and I 
> want to wean myself off microsoft access. CakePHP looks interesting. I have 
> never really done anything in PHP, but I have at times studied it and 
> believe I could master it. Tried Ruby on Rails but learning curve was steep 
> considering I have a day job. 
>
> So I have another project that could start off as a very simple CRUD app, 
> but I want to make it much more powerful over time. It would store lab 
> data. Lots of different tests on lots of samples. I built apps like this in 
> Access b4 that were quite useful. Back to PHP and Cake. I made a virtual 
> Ubuntu Server yesterday and installed Cake 2.6.3. Haven't gone any further. 
> Then I read about Cake3. I like what read about the new ORM. What to do... 
> Should I go ahead and make my simple app in 2.6.3 or start right off with 
> the quite new version 3? Should I learn more PHP first? Can I install Cake3 
> side by side with Cake 2.6.3? Thanks in advance.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Lazy loading components

2015-03-18 Thread euromark
They need to be able to run initialize() and startup() before any action, 
so thats hard to do.
And yes, micro-opt. without a real value IMO :)

Mark


Am Mittwoch, 18. März 2015 11:53:14 UTC+1 schrieb Gonçalo Marrafa:
>
> Hi there!
>
> Is there a way to enable lazy loading of components? As far as i can tell 
> (i'm using 2.6.3) all components listed in $components variable are 
> loaded and initialized when the controller is loaded. Shouldn't it use the 
> same logic as models in which models are only loaded and initialized when 
> used? Am i doing something wrong?
>
> As an example, if i have a controller that uses the Paginator component in 
> one action but has ten actions, in all nine other actions the component is 
> created without need. Maybe micro-optimizing but still
>
> Thanks in advance.
>
> Gonçalo.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Fatal error: Call to a member function link() on a non-object in

2015-02-26 Thread euromark
That is 1.2 syntax, this isnt supported for the last 5 years.
What kind of code are you working with, and why are you trying to use it 
with recent versions of CakePHP?
Please consult the documentation on how to properly call helpers (besides 
the fact that this helper doesnt exist anymore).

mark


Am Donnerstag, 26. Februar 2015 09:06:57 UTC+1 schrieb JAI PRAKASH SINGH:
>
> hello all, 
>
>  i am very new to cake php, hardly 2-3 days , i stated working on 
> project.
>  i am facing a error i.e
>
> Fatal error: Call to a member function link() on a non-object in
>
> line "
> app/views/layout/default.ctp 
>
>  echo $javascript->link(array(FV_JS . "jquery-1.7.1.min.js?v=" . 
> VERSION_NUMBER));
> ?>
>
>
>i have searched a lot but unable to solved this problem 
>
> please share you reply, if any file u want to see, please tell 
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: how can i return to page with same search filters

2015-02-19 Thread euromark
Trust me, it is easier than what you are trying to do :)
And only 1-2 lines of code and it works out of the box.


Am Donnerstag, 19. Februar 2015 23:18:56 UTC+1 schrieb ajt:
>
> I had a look it and it looks difficult to use.
> NOt sure if this is the best way to go and where is a complete example and 
> ability to go back to the page?
>
> This doesnt really help
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: how can i return to page with same search filters

2015-02-19 Thread euromark
IMO you shouldnt reinvent the wheel (with design flaws in it), but re-use 
best practice approaches via plugin form that have been working
for many years with ease:
https://github.com/CakeDC/search is the de facto standard for easy 
filtering of your paginated data

Mark


Am Donnerstag, 19. Februar 2015 15:02:10 UTC+1 schrieb ajt:
>
> Hi, 
>
> In cakephp I can add search filters and change the post vars into Get as 
> below. This works fine. My problem is how do go to another page found from 
> the list of searches and return to the same page? All search filters are 
> gone when i return as I am not storing them.
>
> eg I search for invoice 2 and get a list of searches. i click on link from 
> the search and view a page. I then want to return to the same page with 
> same page number for invoice 2?
>
> if (($this->request->is('post') ||$this->request->is('put'))&& 
> isset($this->request->data['filter'])) {
>
>$filter_url['controller'] = $this->request->params['controller'];
>$filter_url['action'] = $this->request->params['action'];
>$filter_url['page'] = 1;
> // for each filter we will add a GET parameter for the generated 
> urlforeach($this->data['Filter'] as $name => $value){
>if($value){
>$filter_url[$name] = urlencode($value);
>}}   //Post params are now GET paramatersreturn 
> $this->redirect($filter_url);
>}//isset   
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant remove page from url pagination to prevent error

2015-02-19 Thread euromark
no, it is always get (you are not modifying the DB).


Am Mittwoch, 18. Februar 2015 22:44:05 UTC+1 schrieb ajt:
>
> You mean use get instead of post?
>
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant remove page from url pagination to prevent error

2015-02-18 Thread euromark
Are you by any chance mixing named params and query strings?
you shouldnt do that.
It is best to completely drop named params, and instead use query strings 
completely.
I know for a fact that it all works then just fine :)

See www.dereuromark.de/2013/05/04/passed-named-or-query-string-params/
Mark


Am Mittwoch, 18. Februar 2015 14:36:50 UTC+1 schrieb ajt:
>
> Hi, In cakephp
>
>   
>
> I keep getting a page out of range error.
>
> The problem only happens when I am page:2 or above and I perform a search. 
> The search works fine unless this is only 1 page found and then I get the 
> error if the URL has page 2 or above.
>
> I tried resetting the page no, to 1 and I tried a try/catch block without 
> any success, from previous posts. 
>
> How can I perform a search and reset the page:x back to page1 so I dont 
> get this error? I couldnt find this answer in the docs or google.
>
>
> http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper
>  
>
> Error: The requested address '../admin_list2/page:2' was not found on this 
> server.
>
> in controller 
>
>
>   $this->Paginator->settings = array(
>   'conditions'=> array 
> ($tutor=>$tutorId,$conditionStartDate=>$valStartdate, 
>   $conditionEndDate=>$valEnddate, 
> $conditionInvoice=>$invoice),
>'order' => 
> array('TimeSheet.period_start_date'=>'desc'),   
>'limit' => $noRecords,
> 'page' => 1,
>'recursive'=>-1);  
>
>
>
> $timesheet= $this->Paginator->paginate('TimeSheet');
>
>
> try {
> $this->Paginator->paginate();
> } catch (NotFoundException $e) {
> //Do something here like redirecting to first or last page.
>
> debug('error'); // never works
> }
>
> http://list2/page:2
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is possible to make a online ticket booking website in CakePhp

2015-02-10 Thread euromark
http://stackoverflow.com/questions/28409805/is-possible-to-make-a-online-ticket-booking-website-in-cakephp
answers it all

Am Dienstag, 10. Februar 2015 06:20:58 UTC+1 schrieb nicky:
>
> Dear,
>
> You can make any kind of web application in the Cake-PHP, it is just a 
> framework and you should know its convention first, what it can do and what 
> it can not .
> The answer is YES you can .
>
> On Mon, Feb 9, 2015 at 5:58 PM, Ankit Jaiswal  > wrote:
>
>> HI,Maybe the question similar to this has been asked so many times, and 
>> many may votes this down, But i am really confused and i think its the best 
>> place to ask the professionals to resolve my problem.  
>>
>>I have worked with Cakephp, Now I got a project where I have to create 
>> a website for online ticket booking system.
>>
>> So As the starting phase of project  before diving in to it I have to be 
>> sure *Is possible to make a online ticket booking website in CakePhp*
>>
>> Because right now I am working on  a website which has made in Cake Php, 
>> its not as Session oriented and not required  *ACID* property of 
>> Database which is the base of Online ticket booking system.
>>
>>So Please help me out and suggest me ideas related to it.
>>
>>  Thanks in Advance
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Action a postLink without refreshing page (AJAX?)

2015-02-08 Thread euromark
Maybe this helps?
http://stackoverflow.com/questions/9750326/intercept-cake2-postlink-form-posts-with-jquery


Am Samstag, 7. Februar 2015 17:34:38 UTC+1 schrieb MarkB:
>
> Hi,
>
> My first Cake project (and first major non-intranet web project!) is a 
> fairly complex event management system for a month-long city-wide science 
> festival my employer runs, involving about 120 events.
>
> I have added the ability to add (and remove) events to a wishlist from a 
> *postLink*, which works well on the event view page, but is annoying for 
> users when clicking the 'Add to wishlist' link in the events listings page, 
> as the page refreshes and they may have to scroll down to continue browsing 
> where they left off.
>
> I've been messing about with PHP for years, but have little Javascript 
> experience and nothing AJAX-based. Time is getting tight, so I'm wondering 
> if there is anyone who can help me achieve this? Thanks!
>
> This is the code I use in my view:
>
>  if ($wishlisted == NULL){
>  echo $this->Form->postLink('Add to wishlist', array('action' => 'wishadd'
> , $event['Event']['id']));
>  } else {
>  echo "On your wishlist " . $this->Form->postLink('Remove', array('action' 
> => 'wishlistremove', $wishlisted));
>  }
>
>
>
>
> This is my Controller code:
>
> public function wishadd($id) {
>  if ($this->request->is('get')) {
> throw new MethodNotAllowedException();
> }
>  $user_id = $this->Auth->user('id');
>  if ($user_id == NULL) {
> $this->Session->setFlash('You must be logged in to add an event to a 
> wishlist!');
> return $this->redirect(array('action' => 'view',$id));
> }
>  $currentYear = $this->getSettings('year');
> $event = $this->Event->findById($id); 
>  $conditions = array('Wishlist.year' => $currentYear,'Wishlist.event_id' 
> => $id,'Wishlist.user_id' => $this->Auth->user('id'));
> $wishlisted = $this->Event->Wishlist->find('count',array('conditions' => 
> $conditions));
>  if ($wishlisted > 0) {
> $this->Session->setFlash('This event is already on your wishlist.');
> return $this->redirect($this->referer());
> }
>  if ($this->request->is('post')) {
>  $this->Event->Wishlist->create();
> $wishlist_id = $this->Event->Wishlist->getInsertID();
> $this->Event->Wishlist->saveField('year', $currentYear);
> $this->Event->Wishlist->saveField('event_id', $id);
> $this->Event->Wishlist->saveField('proposal_id', 
> $event['Event']['proposal_id']);
> $this->Event->Wishlist->saveField('user_id', $user_id);
>  $this->Session->setFlash('This event has been added to your wishlist.');
> return $this->redirect($this->referer());
> } else {
> $this->Session->setFlash('Unable to add to your wishlist. Please try 
> again.');
> return $this->redirect($this->referer());
>  }
> }
>
>
>
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Soft delete plugin for cakephp 3

2015-02-02 Thread euromark
Feel free to add it 
to https://github.com/FriendsOfCake/awesome-cakephp/tree/cake3
Thats the list people would look for plugins and alike :)

mark


Am Sonntag, 1. Februar 2015 03:40:21 UTC+1 schrieb Pgbi:
>
> Hi guys,
>
> For one of my projects, I developed a plugin to nicely handle soft 
> deletion for some of my models. I thought I might share it with the 
> community (hope this is the right place to do it).
> It can be found here => 
> https://packagist.org/packages/pgbi/cakephp3-soft-delete
>
> Any remarks about it will be appreciated!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cakephp Autocomplete Tutorial ajax error

2015-02-01 Thread euromark
It is best not to use the JS helper(s) etc.
Use just plain jQuery and it will work quite easily out of the box

See http://sandbox.dereuromark.de/sandbox/ajax_examples/ for live examples
mark


Am Sonntag, 1. Februar 2015 01:13:54 UTC+1 schrieb ajt:
>
>
>
> In CakePHP, I am trying to create a autocomplete function from a textbox, 
> using this tutorial: http:
> //bakery.cakephp.org/articles/matt_1/2011/08/07/yet_another_jquery_autocomplete_helper_2
>
>
> I keep getting a
>
> Undefined index: autoCompleteText
>
>
> I solved the helper issue as it finds the helper as this is cakephp 1.X 
> code and I have 2.X
>
>
> controller - Tests
> function auto_complete
>
>
>
> class TestsController extends AppController {
>
> public $helpers = array('Html', 'Form', 'Session','Js','AutoComplete');
>
>  public function auto_complete() {
>  $this->loadModel('Tutor');
>  debug( $this->params);
>
>
> $terms = $this->Tutor->find('all', array(
> 'conditions' => array(
> 'Tutor.first_name LIKE' => 
> $this->params['url']['autoCompleteText'].'%'
> ),
> 'fields' => array('Tutor.first_name'),
> 'limit' => 3,
> 'recursive'=>-1,
> ));
> $terms = Set::Extract($terms,'{n}.Tutor.first_name');
> $this->set('terms', $terms);
> $this->layout = '';
> } 
>
>
>
> view
>  auto_complete.ctp
>
>
>  echo $this->AutoComplete->input(
> 'Tutor.first_name',
> array(
> 'autoCompleteUrl'=>$this->Html->url( 
> array(
> 'controller'=>'tests',
> 'action'=>'auto_complete',
> )
> ),
> 'autoCompleteRequestItem'=>'autoCompleteText',
> )
> );
>
>   if(isset($terms)) {
> echo $this->Js->object($terms);
>   }
>
>echo $this->Form->create('');
>
> echo $this->Form->input('type', array('label' => 'Choose' ));
>echo $this->Form->end('send'); 
>
>  ?>
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Session date missing after redirect

2015-01-25 Thread euromark
Hope you didnt have too many files to manually check.
You know that there are tons of tools for that, right?

E.g. 
https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/PhpTagShell.php
or 
https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/WhitespaceShell.php

mark


Am Freitag, 23. Januar 2015 19:44:48 UTC+1 schrieb Ken Winans:
>
> It wasn't a call to pr() or an echo. It was whitespace following a closing 
> PHP tag. I just went through every file and got rid of every closing PHP 
> tag. Should have done it a long time ago.
>
> I only have myself to blame. :-o
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: deploying CakePHP app

2015-01-25 Thread euromark
One of the most simple scripts is maybe sth like


#!/bin/bash

echo "### INSTALL ###";

php composer.phar selfupdate

git pull

php composer.phar install --prefer-dist --no-dev --optimize-autoloader

echo "### CLEANUP ###";
rm -rf ./tmp/cache/models/*
rm -rf ./tmp/cache/persistent/*

echo ### DONE ###;
exit


Which is then called as "sh build.sh"
but you should change to the right user (probably www-data)

it can most likely also be triggered from some ssh connection.
If you do, you might also want to use "--no-interaction" for composer 
install/update.
mark


Am Samstag, 24. Januar 2015 10:21:25 UTC+1 schrieb Radharadhya Dasa:
>
> I read both lins but the picture is still not clear for me. 
>
> I want something simple script what checks what is the version on the 
> server and update it on the production server. What if I just have a 
> normal git repo on the production server and run git pull regularly? 
> Is it a safe way to do it? 
>
> rrd 
>
> 2015-01-15 12:56 GMT+01:00 Rafael Queiroz >: 
>
> > Using git hooks (http://git-scm.com/book/be/v2/Customizing-Git-Git-Hooks) 
> or 
> > capistrano (http://capistranorb.com/). 
> > 
> > On Thu, Jan 15, 2015 at 8:49 AM, Radharadhya Dasa  wrote: 
> >> 
> >> Hi, 
> >> 
> >> I have a CakePHP app hosted at github. What is the best way to deploy 
> it 
> >> to the production server? 
> >> 
> >> rrd 
> >> 
> >> -- 
> >> Like Us on FaceBook https://www.facebook.com/CakePHP 
> >> Find us on Twitter http://twitter.com/CakePHP 
> >> 
> >> --- 
> >> You received this message because you are subscribed to the Google 
> Groups 
> >> "CakePHP" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an 
> >> email to cake-php+u...@googlegroups.com . 
> >> To post to this group, send email to cake...@googlegroups.com 
> . 
> >> Visit this group at http://groups.google.com/group/cake-php. 
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > 
> > 
> > -- 
> > Atenciosamente, 
> > 
> > Rafael F. Queiroz 
> > 
> > -- 
> > Like Us on FaceBook https://www.facebook.com/CakePHP 
> > Find us on Twitter http://twitter.com/CakePHP 
> > 
> > --- 
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "CakePHP" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/cake-php/VXDnGLnMAog/unsubscribe. 
> > To unsubscribe from this group and all its topics, send an email to 
> > cake-php+u...@googlegroups.com . 
> > To post to this group, send email to cake...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/cake-php. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Session and PHP Unit Test

2015-01-21 Thread euromark
in 3.x the --stderr of course is not necessary anymore

For 3.x please use the IntegrationTest as it is designed, so add

$this->session($data), instead of actually writing to the session.

Mark



Am Mittwoch, 21. Januar 2015 12:49:17 UTC+1 schrieb monica:
>
> Thanks mark for tip ;)
>
> I've checked with that option and nothing really changed. I forgot to 
> mention it's cakephp 3.0.
> This is the command I'm running:
>
> php phpunit.phar --stderr -v tests/TestCase/Controller/
> UnitTestsControllerTest.php
>
>
>
>
>
> On Tuesday, 20 January 2015 18:58:47 UTC, euromark wrote:
>>
>> Dont forget --stderr when testing 2.x tests in CLI
>>
>> mark
>>
>>
>> Am Dienstag, 20. Januar 2015 13:29:47 UTC+1 schrieb monica:
>>>
>>> Hi!
>>>
>>> I baked new UnitTestsController for testing purposes and put inside the 
>>> function:
>>>
>>>
>>> public function reset_filters() {
>>>  // suppose to delete CurrentFilter var from session
>>>  this->request->session()->delete('CurrentFilter');
>>> }
>>>
>>>
>>> I wanted to test session so I baked also UnitTestsControllerTest.php 
>>>
>>> public function testResetFilters() {
>>>  $session = new Session;
>>>  
>>>  $session->write([
>>> 'WhatIsInside' => 'littlebunny',
>>> 'CurrentFilter' => 'this is the filter'
>>> ]);
>>>  
>>>  // saving one of session vars
>>>  $oldUserSession = $session->read('WhatIsInside');
>>>  
>>>  // calling function which suppose to delete the other session 
>>> var (CurrentFilter) and leave WhatIsInside session var untouched
>>>  $this->get('/UnitTests/reset_filters');
>>>  
>>>  // getting that other var from session
>>>  $newUserSession = $session->read('WhatIsInside');
>>>
>>>  // checking if function hasn't deleted the other session vars
>>>  $this->assertSame($oldUserSession, $newUserSession);
>>> }
>>>
>>>
>>> But the test *failed*. 
>>>
>>> I printed content of both sessions data before and after function.
>>> Before function is giving me correct output but after calling the 
>>> function it's giving me null.
>>>
>>> Console output:
>>>
>>>
>>> There was 1 failure:
>>>
>>> 1) App\Test\TestCase\Controller\UnitTestsControllerTest::testResetFilters
>>> Failed asserting that null is identical to 'littlebunny'.
>>>
>>>
>>>
>>> I don't what I did wrong and any help will be appreciated. 
>>>
>>>
> *** CONFIDENTIALITY NOTICE AND LEGAL LIABILITY WAIVER ***
>
> The content of this email and any attachments are CONFIDENTIAL and may 
> contain privileged information. If you are not the addressee it may be 
> UNLAWFUL for you to read, copy, distribute or disclose the information 
> contained herein. This email and any attachments may not reflect the 
> opinions of the originating company or any party it is representing. 
> Telephone calls may be recorded for training and quality monitoring 
> purposes.
>
> The Car Finance Company (2007) Ltd Registered Address is 47-51 Kingston 
> Crescent, Portsmouth, PO2 8AA and is authorised and regulated by the 
> Financial Conduct Authority, CCL number 600168. 
>
> The Car Finance Company (Trade Sales) Ltd is a wholly owned subsidiary of 
> The Car Finance Company (2007) Ltd. Registered Address is 47-51 Kingston 
> Crescent, Portsmouth, PO2 8AA and is authorised and regulated by the 
> Financial Conduct Authority, CCL number 663690.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 e mysql fields ENUM

2015-01-20 Thread euromark
Hi!
Read the link I gave you.
That answers everything already for you.

Mark

Am Dienstag, 20. Januar 2015 15:15:02 UTC+1 schrieb Leandro Machado Pereira:
>
> Hi mark, sorry for late in my answer.
>
> I search more information for mysql field ENUM and gave up using this type.
>
> However, i need for of one field in my model for manager de columns STATUS.
>
> I can't use Enum because the value of the STATUS isn't same in another 
> model.
>
> What you think i can do ?
>
> I think do one properties in each model, but i don't know how do this.
>
> Em Fri Jan 16 2015 at 15:54:48, euromark > 
> escreveu:
>
>> Enums are a bad thing anyway.
>> Better use sth of the options listed @ 
>> http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/
>>
>> mark
>>
>> Am Donnerstag, 15. Januar 2015 23:18:45 UTC+1 schrieb Leandro Machado 
>> Pereira:
>>>
>>> I gave up using enum.
>>> Thanks.
>>>
>> Em Thu Jan 15 2015 at 17:31:51, Leandro Machado Pereira <
>>> llper...@gmail.com> escreveu:
>>>
>>>> Hey guy, I tried to do work my fields with mysql ENUM.
>>>>
>>>> In cake 2.0 i used this helper.
>>>>
>>>> http://www.drawbackz.com/stack/251186/cakephp-2-0-use-
>>>> mysql-enum-field-with-form-helper-to-create-select-input.html
>>>>
>>>> But in cake 3.0 i'm have dificults for work fine.
>>>>
>>>> I received errors in this line.
>>>>
>>>> $modelKey = $this->model();
>>>>
>>>> and in this line:
>>>>
>>>> $this->fieldset[$modelKey]['fields'][$fieldName]['type'],
>>>>
>>>> So, does somebody have any suggestions ?
>>>>
>>>> Thanks.
>>>>
>>>> -- 
>>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>>> Find us on Twitter http://twitter.com/CakePHP
>>>>
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "CakePHP" group.
>>>>
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to cake-php+u...@googlegroups.com.
>>>> To post to this group, send email to cake...@googlegroups.com.
>>>
>>>
>>>> Visit this group at http://groups.google.com/group/cake-php.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Session and PHP Unit Test

2015-01-20 Thread euromark
Dont forget --stderr when testing 2.x tests in CLI

mark


Am Dienstag, 20. Januar 2015 13:29:47 UTC+1 schrieb monica:
>
> Hi!
>
> I baked new UnitTestsController for testing purposes and put inside the 
> function:
>
>
> public function reset_filters() {
>  // suppose to delete CurrentFilter var from session
>  this->request->session()->delete('CurrentFilter');
> }
>
>
> I wanted to test session so I baked also UnitTestsControllerTest.php 
>
> public function testResetFilters() {
>  $session = new Session;
>  
>  $session->write([
> 'WhatIsInside' => 'littlebunny',
> 'CurrentFilter' => 'this is the filter'
> ]);
>  
>  // saving one of session vars
>  $oldUserSession = $session->read('WhatIsInside');
>  
>  // calling function which suppose to delete the other session var 
> (CurrentFilter) and leave WhatIsInside session var untouched
>  $this->get('/UnitTests/reset_filters');
>  
>  // getting that other var from session
>  $newUserSession = $session->read('WhatIsInside');
>
>  // checking if function hasn't deleted the other session vars
>  $this->assertSame($oldUserSession, $newUserSession);
> }
>
>
> But the test *failed*. 
>
> I printed content of both sessions data before and after function.
> Before function is giving me correct output but after calling the function 
> it's giving me null.
>
> Console output:
>
>
> There was 1 failure:
>
> 1) App\Test\TestCase\Controller\UnitTestsControllerTest::testResetFilters
> Failed asserting that null is identical to 'littlebunny'.
>
>
>
> I don't what I did wrong and any help will be appreciated. 
>
>
>
>
> *** CONFIDENTIALITY NOTICE AND LEGAL LIABILITY WAIVER ***
>
> The content of this email and any attachments are CONFIDENTIAL and may 
> contain privileged information. If you are not the addressee it may be 
> UNLAWFUL for you to read, copy, distribute or disclose the information 
> contained herein. This email and any attachments may not reflect the 
> opinions of the originating company or any party it is representing. 
> Telephone calls may be recorded for training and quality monitoring 
> purposes.
>
> The Car Finance Company (2007) Ltd Registered Address is 47-51 Kingston 
> Crescent, Portsmouth, PO2 8AA and is authorised and regulated by the 
> Financial Conduct Authority, CCL number 600168. 
>
> The Car Finance Company (Trade Sales) Ltd is a wholly owned subsidiary of 
> The Car Finance Company (2007) Ltd. Registered Address is 47-51 Kingston 
> Crescent, Portsmouth, PO2 8AA and is authorised and regulated by the 
> Financial Conduct Authority, CCL number 663690.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Session date missing after redirect

2015-01-19 Thread euromark
You must have some special session setup.
For no one else this happens - ever.

Try to set up a completely fresh system and debug that one piece by piece.
If that happens there too its most likely a server issue.

Otherwise it is probably a misconfiguration in your configs in CakePHP etc.

mark


Am Montag, 19. Januar 2015 23:15:29 UTC+1 schrieb kdubya:
>
> A kind person on IRC suggested that the problem might be fixed by going to 
> the latest version of Cake. So I updated to 2.6.1 and the problem still 
> exists.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: When to use appcontroller

2015-01-17 Thread euromark
You could use a component instead.

mark

Am Mittwoch, 14. Januar 2015 02:10:39 UTC+1 schrieb Ben Merton:
>
> I'm wanting to make certain variables (counts of various records) to be 
> used on most views in my app. Currently I'm both loading each relevant 
> model and doing the count operation to create the variable I want to pass 
> to my views within the appcontroller as it will then be available to every 
> view. Is this the best way to do it or is there a better way to do it that 
> keeps the code out of the appcontroller.
>
> For context, I'm showing user statistics on each page of the users part of 
> the site.
>
> Thanks!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Authentication and multiple ajax request

2015-01-17 Thread euromark
Well, what you are doing there is pretty wrong in the first place.
Calling login($data) directly logs in whatever you send it (see the docs 
for details), rendering a form login process invalid and insecure.
You should, just as with any other non-ajax request, properly use the Auth 
adapters to log that person in, thus preventing
it from being called twice.
Because if your wrong login() call does work the first time (as it always 
does with whatever data you feed it), the second one
then fails because that person is already logged in. This can and should be 
caught before hand and the login process then aborted
with the message "already logged in".

mark



Am Samstag, 17. Januar 2015 07:12:45 UTC+1 schrieb Ryan de Haast:
>
> Hi All
>
> I recently discovered that cake authentication class does not like 
> multiple ajax requests.
>
> While recently testing my app, I found it would return a 403 error the 
> moment I do multiple ajax requests on a logged in user.
>
> I managed to narrow it down to the following code:
>
>
> $auth = $this->Session->read("Auth");
>>
>> $this->Auth->login($auth);
>>
>> $this->Session->write("Auth",$auth);
>>
>
> The Auth session variable would contain all the login details based on the 
> user.
>
> The above code is in the beforeFilter function within my AppController. 
> Upon debugging the first ajax attempt would send the $auth variable through 
> to the $this->Auth->login($auth); however every other ajax event would fail 
> result in a 403 error being returned.
> After much debugging I managed to discover the above. I checked on every 
> test run whether the session variable returned any data and whether the 
> session data was passed through to isAuthorized function in the same 
> controller.
>
> The session data was never empty, but would only enter the isAuthroized 
> function on the first ajax event, but not on the consecutive ajax events.
>
> Would anybody know a solution to this problem?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: ACL View

2015-01-16 Thread euromark
A few points:
- 
https://github.com/GWD-WEB/acl-view/blob/master/Controller/PermissoesController.php#L2
 
is an invalid use statement
- the plugin is missing test cases (which would have revealed point 1)
- you should add composer support, as this is the de facto standard at this 
point to include plugins

keep it up

Mark


Am Freitag, 16. Januar 2015 20:45:30 UTC+1 schrieb will:
>
> Hi everyone!
>
> My company released a (little) small plugin that helps management of ACL 
> Permissions on Cake.
>
> Feel free to use and send suggetions or bug reports!
>
> https://github.com/GWD-WEB/acl-view
>
> Thanks
>
> Willen Goulart
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 e mysql fields ENUM

2015-01-16 Thread euromark
Enums are a bad thing anyway.
Better use sth of the options listed 
@ http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/

mark

Am Donnerstag, 15. Januar 2015 23:18:45 UTC+1 schrieb Leandro Machado 
Pereira:
>
> I gave up using enum.
> Thanks.
> Em Thu Jan 15 2015 at 17:31:51, Leandro Machado Pereira <
> llper...@gmail.com > escreveu:
>
>> Hey guy, I tried to do work my fields with mysql ENUM.
>>
>> In cake 2.0 i used this helper.
>>
>>
>> http://www.drawbackz.com/stack/251186/cakephp-2-0-use-mysql-enum-field-with-form-helper-to-create-select-input.html
>>
>> But in cake 3.0 i'm have dificults for work fine.
>>
>> I received errors in this line.
>>
>> $modelKey = $this->model();
>>
>> and in this line:
>>
>> $this->fieldset[$modelKey]['fields'][$fieldName]['type'],
>>
>> So, does somebody have any suggestions ?
>>
>> Thanks.
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread euromark
Never mind my solution then. It would need a little bit more knowledge of 
how CakePHP works.
Even though it would exactly do what you want to.

Try to read the wiki documentation and study the plugin code more, that 
might clarify it a bit.
But note that this is an extended FormHelper, not the core one.


Am Freitag, 9. Januar 2015 22:11:03 UTC+1 schrieb Lorne Dudley:
>
> Hello Mark !
>
> Thanks for this.  At first glance I do not see any difference between the 
> #L16 and the #L44 version.
>
> I have loaded the #L44 version as /src/View/Helper/FornHelper.php.
>
> I do not know where to place
> Configure::write('FormConfig.novalidate', 'true');
>
> I'm a cakePHP novice. Can you give me more detailed instruction ?
> What I would like to achieve is to have the "novalidate" active for any 
> forms that might appear in the application.
>
> How and where do I set up "Configure::write('FormConfig.novalidate', 
> 'true');" so that it is called only on start-up ?
>
> Regards
>
> Lorne
>
> On Friday, January 9, 2015 at 2:45:21 PM UTC-5, euromark wrote:
>>
>> Lorne
>> you can actually set a config on the user side when using sth similar I 
>> did in my plugin (since 2.x).
>>
>> You can either use my Tools plugin directly, or copy and paste the 
>> relevant part:
>>
>> https://github.com/dereuromark/cakephp-tools/blob/cake3/src/View/Helper/FormHelper.php#L16
>>
>> https://github.com/dereuromark/cakephp-tools/blob/cake3/src/View/Helper/FormHelper.php#L44
>>
>> You can disable it globally or locally via
>> Configure::write('FormConfig.novalidate', 'true');
>>
>> then :)
>>
>> No need to mess with any templates in this case.
>> Mark
>>
>>
>> Am Freitag, 9. Januar 2015 17:50:54 UTC+1 schrieb Lorne Dudley:
>>>
>>> Hello José
>>>
>>> Thanks for the reference.  If I interpret the manual properly, I think 
>>> it wants me to store the custom widget under the 
>>> /vendor/cakephp/cakephp/src/View/Widget/ directory structure  ?  
>>>
>>> If this is correct then would the custom widget be wiped out every time 
>>> I did a "composer update" ? 
>>>
>>>  I found this to be the case when I had managed to default the form 
>>> submission to "formnovalidate " using a different technique under the 
>>> /vendor structure. 
>>>
>>>  In the FormHelper.php function widget() I added the line 
>>> unset($data['required']); // turn off HTML5 browser validation 
>>> after the line
>>> unset($data['secure']);
>>>
>>> This was replace to the original (or updated) version when I did the 
>>> "composer update".
>>>
>>> What I was really hoping for was perhaps a method of setting a /config 
>>> option on the user side.
>>>
>>> Regards
>>>
>>> Lorne
>>>
>>> On Thursday, January 8, 2015 at 11:28:48 PM UTC-5, Lorne Dudley wrote:
>>>>
>>>> I have finally found the method to turn off browser validation so that 
>>>> cakePHP can take control of the validation instead.  
>>>>   
>>>> This works for me.  
>>>>   
>>>> Form->button(__('Submit'), array('formnovalidate' => 
>>>> true)) ?>  
>>>>   
>>>> Rather than do this for every Form, is there any way to set this option 
>>>> for Forms globally on the user side ?  
>>>>   
>>>> Regards
>>>>
>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread euromark
Lorne
you can actually set a config on the user side when using sth similar I did 
in my plugin (since 2.x).

You can either use my Tools plugin directly, or copy and paste the relevant 
part:
https://github.com/dereuromark/cakephp-tools/blob/cake3/src/View/Helper/FormHelper.php#L16
https://github.com/dereuromark/cakephp-tools/blob/cake3/src/View/Helper/FormHelper.php#L44

You can disable it globally or locally via
Configure::write('FormConfig.novalidate', 'true');

then :)

No need to mess with any templates in this case.
Mark


Am Freitag, 9. Januar 2015 17:50:54 UTC+1 schrieb Lorne Dudley:
>
> Hello José
>
> Thanks for the reference.  If I interpret the manual properly, I think it 
> wants me to store the custom widget under the 
> /vendor/cakephp/cakephp/src/View/Widget/ directory structure  ?  
>
> If this is correct then would the custom widget be wiped out every time I 
> did a "composer update" ? 
>
>  I found this to be the case when I had managed to default the form 
> submission to "formnovalidate " using a different technique under the 
> /vendor structure. 
>
>  In the FormHelper.php function widget() I added the line 
> unset($data['required']); // turn off HTML5 browser validation 
> after the line
> unset($data['secure']);
>
> This was replace to the original (or updated) version when I did the 
> "composer update".
>
> What I was really hoping for was perhaps a method of setting a /config 
> option on the user side.
>
> Regards
>
> Lorne
>
> On Thursday, January 8, 2015 at 11:28:48 PM UTC-5, Lorne Dudley wrote:
>>
>> I have finally found the method to turn off browser validation so that 
>> cakePHP can take control of the validation instead.  
>>   
>> This works for me.  
>>   
>> Form->button(__('Submit'), array('formnovalidate' => 
>> true)) ?>  
>>   
>> Rather than do this for every Form, is there any way to set this option 
>> for Forms globally on the user side ?  
>>   
>> Regards
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Validation error on "baked" date field , CakePHP 3

2015-01-08 Thread euromark
Answer is here: https://github.com/cakephp/cakephp/issues/5611


Am Donnerstag, 8. Januar 2015 21:54:34 UTC+1 schrieb Lorne Dudley:
>
> I have a "baked" cakePHP-3.0.0 page which has a field defined as 
> 'date_of_birth date DEFAULT NULL' in TABLE users.  
> When I click the Submit for the "add" function I get  
>   
> Warning (2): preg_match() expects parameter 2 to be string, array given 
> [CORE\src\Validation\Validation.php, line 763]  
> Code Context
>
> protected static function _check($check, $regex)  
> { 
> 
> if (is_string($regex) && preg_match($regex, $check)) { 
> 
> $check = [  
> 'year' => '2014',  
> 'month' => '01',  
> 'day' => '01'  
> ]  
> $regex = 
> '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))([-
>  
> /.])(?:0?2\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\d)?\d{2})([- 
> /.])(?:(?:(?:0?[13578]|1[02])\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\2(?:0?[1-9]|1\d|2[0-8]$%'
>   
>
>   
> Any suggestion on how to fix ?  
> Regards
>   
> The stack trace is  
> 
> preg_match - [internal], line ??
> Cake\Validation\Validation::_check() - 
> CORE\src\Validation\Validation.php, line 763  
> Cake\Validation\Validation::date() - 
> CORE\src\Validation\Validation.php, line 346  
> Cake\Validation\RulesProvider::__call() - 
> CORE\src\Validation\RulesProvider.php, line 53  
> Cake\Validation\RulesProvider::date() - 
> CORE\src\Validation\ValidationRule.php, line 138  
> Cake\Validation\ValidationRule::process() - 
> CORE\src\Validation\ValidationRule.php, line 138  
> Cake\Validation\Validator::_processRules() - 
> CORE\src\Validation\Validator.php, line 554  
> Cake\Validation\Validator::errors() - 
> CORE\src\Validation\Validator.php, line 128  
> Cake\ORM\Marshaller::_validate() - CORE\src\ORM\Marshaller.php, line 
> 185  
> Cake\ORM\Marshaller::merge() - CORE\src\ORM\Marshaller.php, line 341  
> Cake\ORM\Table::patchEntity() - CORE\src\ORM\Table.php, line 1899  
> App\Controller\UsersController::add() - 
> APP/Controller\UsersController.php, line 48  
> Cake\Controller\Controller::invokeAction() - 
> CORE\src\Controller\Controller.php, line 406  
> Cake\Routing\Dispatcher::_invoke() - CORE\src\Routing\Dispatcher.php, 
> line 114  
> Cake\Routing\Dispatcher::dispatch() - CORE\src\Routing\Dispatcher.php, 
> line 87  
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: mailchimp cakephp api

2015-01-01 Thread euromark
Those are all pretty common-knowledge things regarding basic CakePHP stuff, 
if you used it for a while.
It might be best to first get a  grasp on CakePHP and a few easy things, 
and go from there.
Don't try to understand all at once.

Using composer is explained on their page. You could just drag and drop it, 
but the composer approach is usually the cleaner one
You can look at existing projects on how they leverage composer.

The configs file, if not existent can easily be created and loaded in your 
bootstrap as documented.

mark


Am Donnerstag, 1. Januar 2015 04:52:48 UTC+1 schrieb ajt:
>
> Hi, I want to be able to view emails in a cakephp page sent via mailchimp.
>
> The API is here but
> Here are the instructions https://github.com/dereuromark/cakephp-mailchimp
>
>
> 1)Install the plugin into the APP/Plugin folder, ideally via composer. 
> //how? I just copied the extracted zip folder instead, is this OK?
>
>
>
> 2)Make sure it is loaded - using CakePlugin::loadAll(), for example.
> Use the Configure class to set the API data (via APP/Config/configs.php 
> etc):  //there is NO SUCH FILE configs.php
>
>
> //This goes where?
>
> $config['Mailchimp'] = array(
> 'apiKey' => 'YOUR_API_KEY',
> 'defaultListId' => 'YOUR_LIST_ID',
> 'defaultCampaignId => 'YOUR_CAMPAIGN_ID'
> ); 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cake events

2014-12-27 Thread euromark
For a small community application I also still ajax PULL every x seconds 
for this.
As long as the users stay in a range (<  ?) this might very well work 
as a (short term) solution.

The state of the art approach would be  a PUSH notification service, 
though, as described
- here: http://socket.io/
- or here: https://pusher.com/tutorials/html5_realtime_push_notifications

mark


Am Samstag, 27. Dezember 2014 09:01:27 UTC+1 schrieb . .:
>
> Hi. I am implementing a Message system (ie, user A sends a message to user 
> B). After user A sends a message to B, I would like to show the number of 
> unread messages. One way of implementing this is to check for any new 
> messages on every page refresh. Could I instead use trigger a cakephp 
> event? Can I trigger an event in user A's session and have the listener be 
> in another (user B) session? Thanks.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Use function in controller AND view

2014-12-23 Thread euromark
Yeah it says *outside*.
Inside the view layer you don't use CakeNumber, you use the helper Number:
$this->Number->...()

which, of course, internally wraps the CakeNumber functionality.


Am Dienstag, 23. Dezember 2014 13:05:12 UTC+1 schrieb LDSign:
>
> Just one question in addition. The cookbook says
>
> If you need NumberHelper 
> 
>  functionalities 
> outside of a View, use the CakeNumber class:
>
> Whats the point using "CakeNumber::" inside of views instead of 
> $this->Number? Is this just a style quqstion or has it any drawbacks?
>
> Thanks,
> Frank
>
> Am Montag, 22. Dezember 2014 16:06:23 UTC+1 schrieb LDSign:
>>
>> Hi
>>
>> Ive a function which converts a number to currency value (e.g. 10 -> 
>> 10,00 EUR).
>>
>> So far I have a custom "TextHelper" with that method within (becuase its 
>> view related).
>>
>> The problem is, now I need this (exactly same) method in a controller 
>> (for generating a flash message). Of course I could place this as a simple 
>> function in bootstrap.php (and use it in both, controller and view), but as 
>> far as I remember this is bad practice. Bad practice too is to clone this 
>> functionality in a component for DRY reasons.
>>
>> So whats the best practice for such a case?
>>
>> Thanks,
>> Frank
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Use function in controller AND view

2014-12-22 Thread euromark
That's why we refactored the whole thing into a lib class:
https://github.com/cakephp/cakephp/blob/master/lib/Cake/Utility/CakeNumber.php

App::uses('CakeNumber', 'Utility');
$formattedNumber = CakeNumber::currency($value, $currency);

It is documented quite thorougly, by the way:
http://book.cakephp.org/2.0/en/core-utility-libraries/number.html#CakeNumber::currency

Mark



Am Montag, 22. Dezember 2014 16:06:23 UTC+1 schrieb LDSign:
>
> Hi
>
> Ive a function which converts a number to currency value (e.g. 10 -> 10,00 
> EUR).
>
> So far I have a custom "TextHelper" with that method within (becuase its 
> view related).
>
> The problem is, now I need this (exactly same) method in a controller (for 
> generating a flash message). Of course I could place this as a simple 
> function in bootstrap.php (and use it in both, controller and view), but as 
> far as I remember this is bad practice. Bad practice too is to clone this 
> functionality in a component for DRY reasons.
>
> So whats the best practice for such a case?
>
> Thanks,
> Frank
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: check controller variable is used in view

2014-12-20 Thread euromark
I dont think thats possible, especially since they could also be used in 
elements, view blocks etc.

You can, however, add controller test cases, and then remove them piece by 
piece and see if things break.

mark

Am Samstag, 20. Dezember 2014 17:14:15 UTC+1 schrieb Radharadhya Dasa:
>
> Hi,
>
> Is there any tool to check if variables created in controller by 
> $this->set is actual used in the view?
>
> I did some code review for one of my controller methods and I removed 4-5 
> unused variables and the load speed is significantly better. To have some 
> tool for this would be really helpful.
>
> rrd
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Save not escape only field CakePHP 2

2014-12-17 Thread euromark
afaik it only wraps it to be able to safely save it

the data ending up in the db should not be different.
mark


Am Dienstag, 16. Dezember 2014 19:32:10 UTC+1 schrieb John Andersen:
>
> Hi Euromark
>
> Actually CakePHP 2.x does modify the data - it escapes and quotes the data 
> during the save - using the DboSource method value() - found here:
> http://api.cakephp.org/2.5/class-DboSource.html#_value
>
> Called by the DboSource method create() - found here:
> http://api.cakephp.org/2.5/source-class-DboSource.html#974-1021
>
> Enjoy, John
>
> On Tuesday, 16 December 2014 16:56:58 UTC+2, euromark wrote:
>>
>> Actually, the save() etc don't modify your data.
>> They simply store it the same way you give it to them.
>> It might only be displayed this way in your sql backend.
>>
>> [snip]
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 using FormHelper inside MyHtmlHelper

2014-12-16 Thread euromark
See that one?
https://github.com/cakephp/cakephp/blob/3.0/src/View/Helper/HtmlHelper.php#L39

It's dangerous to overwrite a core helper and remove functionality from it.

So you should either not overwrite $helpers, or do it correcty. Meaning, 
appending to it while not removing anything:

public $helpers = ['Url', 'Form']; 


mark


Am Sonntag, 14. Dezember 2014 05:32:59 UTC+1 schrieb Ahmad baiquni habibi:
>
> hi, I try to do 
> http://book.cakephp.org/3.0/en/views/helpers.html#including-other-helpers 
> into MyHtmlHelper, but get error. Please help how to do it properly?
>
> here my code:
>  namespace App\View\Helper;
> use Cake\View\Helper\HtmlHelper;
>
> class MyHtmlHelper extends HtmlHelper {
>  
> 
> public $helpers = ['Form']; 
> /*
> Fatal Error
> Error: Call to a member function build() on a non-object
> File 
> E:\xampp\htdocs\portfolio\hrd\vendor\cakephp\cakephp\src\View\Helper\HtmlHelper.php
> Line: 323
> */
> 
> public function edit($id = null){
> 
> $title = 'edit';
> $url = ['action'=>'edit', $id];
> return $this->link($title, $url, $options = array());
> 
> }
> 
> public function hapus($id = null){
> $title = 'hapus';
> $url = ['action'=>'delete', $id];
> $options['confirm'] = 'yakin menghapus?'; 
> 
> return $this->Form->postLink($title, $url , $options);
> 
> }
> 
> }
>
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Save not escape only field CakePHP 2

2014-12-16 Thread euromark
Actually, the save() etc don't modify your data.
They simply store it the same way you give it to them.
It might only be displayed this way in your sql backend.


Am Dienstag, 16. Dezember 2014 11:44:08 UTC+1 schrieb Rafael Queiroz:
>
> It's a requirement for project, i have no details, just save and deliver 
> data.
> Thanks John.
>
> On Mon, Dec 15, 2014 at 4:39 PM, John Andersen  > wrote:
>>
>> Hi Rafael
>>
>> According to the CakePHP book 2.x, then CakePHP automatically escapes the 
>> Model::save and the Model::find methods, so that your data will be escaped 
>> and saved in the database, but will be un-escaped when you read it back 
>> again.
>>
>> Near this location in the CakePHP book:
>>
>> http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#complex-find-conditions
>>
>> There was no mention of a possibility to turn it off, but it did mention 
>> that you could use Model::query instead, although not recommended as it 
>> gives the possibility for SQL injection to happen.
>>
>> Near this location in the CakePHP book:
>>
>> http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-query
>>
>> Why do you need the content to be non-escaped in the database?
>> Enjoy, John
>>
>>
>> On Monday, 15 December 2014 15:11:50 UTC+2, Rafael Queiroz wrote:
>>>
>>> Hi guys,
>>>
>>> I mockup this data for save:
>>>
>>> 'Banner' => array(
>>> 'title' => 'Test',
>>> 'link' => 'test',
>>> 'content' => '
>>> 
>>> 
>>> >> width="1000" height="292" alt="">
>>> 
>>> 
>>> ',
>>> 'start' => '2014-12-15',
>>> 'expires' => '',
>>> 'position' => '1',
>>> 'active' => '1'
>>> )
>>>
>>> My problem happens after save, the content field in database:
>>>
>>> '\n>> class=\"container\">\n\n
>>> >> width=\"1000\" height=\"292\" alt=\"\">\n
>>> \n\n'
>>>
>>> I don't want  escape only content field, i want save equal (===) to 
>>> mockup data, any solutions? Thanks.
>>>
>>>
>>> -- 
>>> Regards,
>>>
>>> Rafael F. Queiroz
>>>  
>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Atenciosamente,
>
> Rafael F. Queiroz
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0, how to change user password?

2014-12-12 Thread euromark
"as in 2.x"
That means 3.x

So that means you can transfer everything to 3.x
And the link was also for 3.x

mark


Am Freitag, 12. Dezember 2014 16:12:58 UTC+1 schrieb frocco:
>
> I am using cakephp 3
>
> On Thursday, December 11, 2014 6:58:02 PM UTC-5, euromark wrote:
>>
>> The same as in 2.x basically applies.
>> You hash your form field and save it.
>>
>> If you want to send an email for "password forgotten", use a token and 
>> let the user
>> afterwards chose a new one. Don't send the plain password.
>>
>> You can also look into
>>
>> https://github.com/dereuromark/cakephp-tools/blob/cake3/docs/Behavior/Passwordable.md
>>
>> mark
>>
>>
>>
>> Am Donnerstag, 11. Dezember 2014 17:14:10 UTC+1 schrieb frocco:
>>>
>>> Hi All,
>>>
>>> Looking for an example that allows users to change their password.
>>>
>>> Thank you
>>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0, how to change user password?

2014-12-11 Thread euromark
The same as in 2.x basically applies.
You hash your form field and save it.

If you want to send an email for "password forgotten", use a token and let 
the user
afterwards chose a new one. Don't send the plain password.

You can also look into
https://github.com/dereuromark/cakephp-tools/blob/cake3/docs/Behavior/Passwordable.md

mark



Am Donnerstag, 11. Dezember 2014 17:14:10 UTC+1 schrieb frocco:
>
> Hi All,
>
> Looking for an example that allows users to change their password.
>
> Thank you
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: In CakePHP 3, how do I check if user is logged in and has admin rights?

2014-12-08 Thread euromark
Yes, you can simply use Auth->allow(listofactionnames) as documented to 
make the non admin actions public.
either in each controller, or globally in your app controller


Am Montag, 8. Dezember 2014 19:28:17 UTC+1 schrieb frocco:
>
> I have another question.
>
> I used bake with the prefix admin and now need to protect each controller 
> to allow admin only.
>
> Is this done in the beforeFilter?
>
> What is the correct syntax?
>
> Thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: In CakePHP 3, how do I check if user is logged in and has admin rights?

2014-12-08 Thread euromark
Same thing. Just use this wrapper.
And use debug kit to see how the session data looks like.
But you should be able to use the knowledge you gained in my previous 
answer to translate it to the role question.
The answer is right in front of you.

mark


Am Montag, 8. Dezember 2014 12:13:53 UTC+1 schrieb frocco:
>
> Thank you,
>
> What is the syntax to check if they have a role called admin?
> Field name is role.
>
>
>
> On Monday, December 8, 2014 5:29:35 AM UTC-5, euromark wrote:
>>
>> if ($this->Session>check('Auth.User.id') {}
>>
>>
>> Am Montag, 8. Dezember 2014 02:32:28 UTC+1 schrieb frocco:
>>>
>>> I want to check in my default layout.
>>>
>>> Thanks
>>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: compare time arrays

2014-12-08 Thread euromark
convert them both to int before comparing should work.
or better yet, use DateTime class and its built in comparison methods.

mark

Am Samstag, 6. Dezember 2014 15:03:16 UTC+1 schrieb ajt:
>
> Hi,
> How do you compare time arrays in cakephp?
> I tried to convert the time to a string without success as I get the same 
> string over again or false.
> There has to be an easy way which is hidden somewhere  in cakephp docs 
> which I couldnt find?
>
>   $rr2=($this->request->data['TutorRequest']['thu_end']); //time array
>$date_string = date('H:i:s', strtotime($rr));
>
> eg both time arrays  but this doesnt work
>   if ( $this->request->data['TutorRequest']['wed_start'] > 
> $this->request->data['TutorRequest']['wed_end']
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: In CakePHP 3, how do I check if user is logged in and has admin rights?

2014-12-08 Thread euromark
if ($this->Session>check('Auth.User.id') {}


Am Montag, 8. Dezember 2014 02:32:28 UTC+1 schrieb frocco:
>
> I want to check in my default layout.
>
> Thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: In CakePHP 3, how do I bake admin controller?

2014-12-04 Thread euromark
No need to move anything
Just use bake correctly as documented:

cake bake ... --prefix admin

That will create it in the right places.


Am Donnerstag, 4. Dezember 2014 17:38:46 UTC+1 schrieb cesar calvo:
>
> After bake just move Templates and Controllers to Admin directory and 
> adjust the Controller namespace
>
> El jueves, 4 de diciembre de 2014 14:03:02 UTC-2, frocco escribió:
>>
>> Thanks,
>>
>> But when I use bake, will it generate the controller under admin?
>>
>>
>> On Wednesday, December 3, 2014 10:55:20 AM UTC-5, frocco wrote:
>>>
>>> I want to create admin controller with view
>>>
>>> Thanks
>>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: new to cakephp, should I learn this over yin/laravel4?

2014-11-26 Thread euromark
What about the (probably even more relevant) third option, using cakephp3 
from here on?


Am Donnerstag, 27. November 2014 00:10:42 UTC+1 schrieb frocco:
>
> Hello,
>
> Just installed cakephp 2 and have played around with it for about two 
> hours.
>
> I have a project and wanted to know if I should continue using cakephp or 
> start on a more recent framework like yin or laravel 4?
>
> I really like the cakephp concepts, and would like to hear from long time 
> users.
>
> Thanks
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: adding input dynamic

2014-11-18 Thread euromark
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html


Am Dienstag, 18. November 2014 11:45:35 UTC+1 schrieb Davidson Santos:
>
> I am trying to create a dynamic input but it does not send the data 
> someone could help me?
>
> Add.ctp:
>
> 
>
> Html->script('jquery-2.0.0.min.js',array('inline' => false)); 
> ?>
>
> 
>
> Form->input('Pedido.0.descricao'); ?>
>
> Form->input('Pedido.0.quantidade'); ?>
>
> Form->input('Pedido.0.unidade'); ?>
>
> Form->input('Pedido.0.desconto'); ?>
>
> Form->input('Pedido.0.subtotal'); ?>
>
> 
> Add Band
>
> 
> var contador = 1;
> $('#add_band').click(function(event) {
> event.preventDefault(); 
> $('#band_list').append(' $this->Form->input("Pedido.'+contador+'.descricao"); ?>');
> $('#band_list').append(' $this->Form->input("Pedido.'+contador+'.quantidade"); ?>');
> $('#band_list').append(' $this->Form->input("Pedido.'+contador+'.unidade"); ?>');
> $('#band_list').append(' $this->Form->input("Pedido.'+contador+'.desconto"); ?>');
> $('#band_list').append(' $this->Form->input("Pedido.'+contador+'.subtotal"); ?>');
>$('#band_list').append('');
> contador++;
> });
> 
>
> Form->end('Salvar');
>
> echo $this->Html->link('Cancelar', array('action'=>'index'));
>
> ?>
> 
>
>
> ServicosController.php:
>
>   public function add() {
>
> if($this->request->is('post')) {
> //debug($this->request->data);exit;
> $this->Servico->create(); 
>
> if ($this->Servico->saveAll($this->request->data)) {
>
> $this->Session->setFlash('Os dados do serviço foram salvos.');
> return $this->redirect(array('action' => 'view/'.$this->Servico->id));  
> }
> else {
> $this->Session->setFlash('Os dados do serviço não puderam ser salvos.');
> }
> }   
> #$servico = $this->Servico->findById('all');
> #$this->set('servico', $servico);
> 
> $clientes = $this->Servico->Cliente->find('list');
> $this->set('clientes', $clientes);
>
> $especialidades = $this->Servico->Especialidade->find('list');
> $this->set('especialidades', $especialidades);
>
> $vendedores = $this->Servico->Vendedor->find('list');
> $this->set('vendedores', $vendedores);
>
> $atendentes = $this->Servico->Atendente->find('list');
> $this->set('atendentes', $atendentes);
>
> $pedidos = $this->Servico->Pedido->find('list');
> $this->set('pedidos', $pedidos);
> }
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for a "is form dirty" plugin

2014-11-14 Thread euromark
That can be done fairly easy by comparing the data before and after.
For example via behavior,
There are some existing ones that log the actual "change" for example to 
db: 
https://github.com/dereuromark/cakephp-tools/blob/master/Model/Behavior/LogableBehavior.php

I bet there are quite a few more out there
Just google for them

Mark



Am Freitag, 7. November 2014 18:27:24 UTC+1 schrieb glk:
>
> Hello everyone,
>
> I'm looking for some type of plugin that will let me find out in the 
> controller (during a post) whether or not the form has actually had any 
> data "changed."
>
> Thanks,
> Greg
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: really verid sql thing

2014-11-09 Thread euromark
Using = with float is usually a very bad idea.

You can look into https://github.com/dereuromark/cakephp-geo and how it 
does the custom finder for this.

mark



Am Sonntag, 9. November 2014 16:39:42 UTC+1 schrieb Radharadhya Dasa:
>
> Hi,
>
> Today I pop into something really strange.
>
> $this->Contacts->find()
>->select(['id', 'name'])
>->where([
> 'lat' => $sameLatLng['lat'],
> 'lng' => $sameLatLng['lng']
>]);
>
> IT creates the following query: SELECT Contacts.id AS `Contacts__id`, 
> Contacts.name AS `Contacts__name` FROM contacts Contacts WHERE (lat = 
> 46.569206 AND lng = 17.68384)
>
> On DebugKit at the sql log panel there is 0 at num rows colomn.
>
> If I copy the same query and run it by phpmyadmin I got 4 entries, and 
> this is the right result.
>
> Everything deleted from /tmp/cache. I working on the same database.
>
> Any idea??? 
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: The AppController

2014-11-06 Thread euromark
Read about https://github.com/FriendsOfCake/crud
it kind of does exactly that - but in a cleaner way :)

mark


Am Donnerstag, 6. November 2014 17:48:05 UTC+1 schrieb David Cole:
>
> I've always wondered if it is a preference or a standard to define 
> function in your AppController instead of your Controller, for example:
>
> public function admin_index() {...}
>
> Instead of doing hte above in each Controller, is it alight to do this in 
> the AppController? This way the function is accessible by all controller 
> and there is minimal duplicate code.
>
> What are the best practices of CakePHP when it comes to this? Will doing 
> the function in each Controller improve performance of the entire 
> application or does it not even matter? Opinions?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-08 Thread euromark
Ah, i misread "last" with "latest".. :)
Well, it is the current latest, but yeah, there might still be a 2.7 
version or something, as I think most will not want to upgrade their 
(large) projects to 3.x any time soon.

Mark


Am Mittwoch, 8. Oktober 2014 13:37:57 UTC+2 schrieb Nilson Pena:
>
> YES. Cakephp 2.x rocks
>
> Em quarta-feira, 8 de outubro de 2014, mark_story  > escreveu:
>
>> 2.6.x is all that is planned for now. With that said, the door is not 
>> closed on a 2.7 if the community really wants it. If there is interest, I 
>> am happy to continue merging new backwards compatible features into 2.x to 
>> form a 2.7 release.
>>
>> -mark
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Prof. Dr. *Nilson Pena*
> Av. ACM, 585, sl. 1205
> Salvador - Bahia
> 71 - 3012-3031
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-06 Thread euromark
Yes
you could have easily found that out yourself, though, looking at the open 
source github repo.

mark


Am Montag, 6. Oktober 2014 09:31:57 UTC+2 schrieb HK:
>
> Is 2.6.0 the last version of 2.x ? 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Increase application process speed

2014-09-26 Thread euromark
If you are talking about CakePHP2.x, use model associations as everything 
is lazy loaded and bind on the fly only creates more code overhead and is 
less DRY.

If you use the core ACL it will for sure have some impact, as row level 
access is usually overkill. But then again its hard to say if it is 
necessary or not if you
dont know the details.
If you want something without much overhead, you can take a look 
at 
http://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/
 
for example.
Always depends on your demands, what you require it to be able to.
mark


Am Freitag, 26. September 2014 15:55:04 UTC+2 schrieb marco metal:
>
> Hi,
>
> If we have a very large scale application, should we use model association 
> in model itself or should we bind and unbind model on the fly in 
> controller. Does it effect the overall speed of the application.
>
> Also does implementing Acl and Auth decreases application speed?  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple role Authorization not working (based on tutorial) Cake 2.5.4

2014-09-26 Thread euromark
Just in case you want to keep the controllers lean and all that authorize 
code out of it in a central file,
you might be interested in taking a look 
at 
http://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/

I always like to code DRY and with clear responsibilities.
Mark


Am Donnerstag, 25. September 2014 18:06:55 UTC+2 schrieb MarkB:
>
> Actually, it wasn't the *beforeFilter*... I had actually also not set up 
> the access rights in my various controllers *isAuthorized *functions
>
> public function isAuthorized($user) {
> if (in_array($this->action, array('dashboard','edit','etcetera'))) {
> return true;
> } 
> return parent::isAuthorized($user);
> } 
>
>
> *I know... RTFM.*
>
>
> *:)*
>
> On Thursday, 25 September 2014 09:49:02 UTC+1, Dario Savella wrote:
>>
>> I think you will need to refer to the passed $user argument as shown in 
>> the docs: 
>> 
>>
>> public function isAuthorized($user) {
>> // Admin can access every action
>> if (isset($user['role']) && $user['role'] === 'admin') {
>>return true;
>> }
>> // Default deny
>> return false;
>> }
>>
>>
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cake3 - Clean way to use session in models

2014-09-23 Thread euromark
I would say: Pass in the data from the controller.

Also - this should give you an answer:
https://github.com/ceeram/blame

mark


Am Dienstag, 23. September 2014 10:02:27 UTC+2 schrieb bato:
>
> Hi,
>
> I would know if there is a way to access to session user in Models. I have 
> a table with user_created and user_modified fields.
> Saving Table user_created is only filled if Entity is new instead 
> user_modified is always filled.
>  
> I can populate user_created and user_modified in controller but I'd like 
> to set those fields in Table *beforeSave* to avoid to always remember to 
> do that in controller each time I save that Table. 
> Indeed this Table is saved in many controllers and other Tables can save 
> it.
>
> Thanks
> Alberto
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Has the naming of controllers in cakePHP 2.5.4 been changed?

2014-09-18 Thread euromark
It always was PostsController.php in 2.x - as documented


Am Donnerstag, 18. September 2014 18:45:58 UTC+2 schrieb vincent mbogo:
>
> I named a post controller for a certain project as posts_controller.php 
> while using cakePHP 2.5.4.I got an error that PostsController.php could not 
> be found.After i renamed to PostsController.php,the error was corrected but 
> i encountered an internal error which i've not been able to solve.Has the 
> naming of the controllers been changed?I'm a newbie to cakePHP so i'll be 
> very glad to get your help bakers.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: View Helper

2014-09-18 Thread euromark
Sure
they can easily add helpers

$controller->helpers[] = 'MyHelper';

If you get the controller via initialize() or startup().



Am Donnerstag, 18. September 2014 00:54:25 UTC+2 schrieb Marcelo Aymone:
>
> Ok...
>
> there any way to load a helper throug a controller component?
>
> I cant modify the original controller...
>
> Em quarta-feira, 17 de setembro de 2014 18h24min27s UTC-3, Marcelo Aymone 
> escreveu:
>>
>> On extending a Form helper, is a good practice inject input fields 
>> automatic, with "echo" command?
>>
>> and...
>>
>> To automatic create some field types, like datepicker, and for example, 
>> datepicker uses bootstrap css and js.
>>
>> How insert that scripts through a helper?
>>
>> 'echo $this->Script' inside a helper is wrong?
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: View Helper

2014-09-17 Thread euromark
helpers should usually "return" things.
Then you are flexible, whether you want to output it or use it in a 
different context

mark


Am Mittwoch, 17. September 2014 23:24:27 UTC+2 schrieb Marcelo Aymone:
>
> On extending a Form helper, is a good practice inject input fields 
> automatic, with "echo" command?
>
> and...
>
> To automatic create some field types, like datepicker, and for example, 
> datepicker uses bootstrap css and js.
>
> How insert that scripts through a helper?
>
> 'echo $this->Script' inside a helper is wrong?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Credit card Expiry Date format in CakePHP 3

2014-09-17 Thread euromark
According to the docs this is all easily possible:
http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html#datetime-options


Am Mittwoch, 17. September 2014 15:48:31 UTC+2 schrieb Jipson Thomas:
>
> Hi ,
> Is there any option with the date input to change the display order. For 
> example now following code is generating two select box first one with the 
> year and second one with the month name. Actually for my project we require 
> to show the month select option first and then the year select box. Also in 
> the month select box we want to show the month number from 01 to 12 instead 
> of month name. Is there any parameter will do it ?
>
> Thanks and Regards,
> Jipson
>
> On Tuesday, 12 August 2014 09:23:42 UTC+1, Jipson Thomas wrote:
>>
>> Thank you Mark. It is working.
>> Regards,
>> Jipson
>>
>> On Monday, 11 August 2014 13:14:37 UTC+1, mark_story wrote:
>>>
>>> You should be able to set day => false in the options to turn off the 
>>> day input.
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 'In test' global variable?

2014-09-16 Thread euromark
I use custom Configure keys for my EmailLib (extends CakeEmail):


   - Don't send emails without Configure::write('Email.live'), but log them 
   away verbosely. For testing.

Basically, you will have to add something like this on your own I am afraid

mark


Am Dienstag, 16. September 2014 14:04:48 UTC+2 schrieb Jeremy Burns:
>
> My model code sends out emails, so when I run my test suite the system 
> triggers multiple emails - which is potentially bad for spam ratings. Is 
> there a global variable I can check so that when 'in test' the messages 
> aren't triggered?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   9   10   >