Tuesday, September 23, 2014

Re: How encrypt IDs

That is one clever idea!


I completely agree with that statement, and i already have this type URL humanly parseable / bookmarkable in the system, for view records, example:

http://www.site.net/product/40/new-asus-gtx-580.html


After add UUID support i get this:


http://www.site.net/product/54212b46-87ec-48b7-8e51-42ea7f000007/new-asus-gtx-580.html


And that is i looking for.


PD: Extend your example: Implementation: It is very easy all you need is to specify your primary key as a CHAR (36) or BINARY (36) and CakePhP will automatically generate them for you, when new records are created.

[http://blog.enbake.com/generating-uuid-with-cakephp/]


Best wishes.



On Monday, 22 September 2014 10:26:32 UTC-4:30, Mike Karthauser wrote:
Hi
If you aren't planning on making any of these urls humanly parseable / bookmarkable, how about just having an path such as 

/edit/

I've been working on a ordering system which when i first select the record to edit i set the id into a session and then just use that on my edit pages.

if you are looking for something bookmarkable  but just don't want numerical ids, perhaps look at implementing UUID

According to the book:

"Rather than using an auto-increment key as the primary key, you may also use char(36). CakePHP will then use a unique 36 character UUID (String::uuid) whenever you save a new record using the Model::save method."


Regards
Mike


On 22 Sep 2014, at 15:48, romel javier gomez herrera <bmxquiks...@gmail.com> wrote:

I use this type URL to edit records:  

/edit/1

where 1 is the ID of the record.

I want to know how implement this type URL:

/edit/7aSes77Gb642r8dx-patPQ08xC6VdZsydO31zA3mVLQ

Best wishes.

--
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.

....................................
Mike Karthäuser
Director, Brightstorm Ltd.

1, Brewery Court
North Street
Bristol
BS3 1JS

mi...@brightstorm.co.uk
www.brightstorm.co.uk
+44(0) 7939252144
....................................

--
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+unsubscribe@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.

No comments: