Re: Creating new rows

2010-02-13 Thread Jeremy Burns
No. Jeremy Burns jeremybu...@me.com On 13 Feb 2010, at 08:20, WebbedIT wrote: The main question is, is it supposed to be creating two rows? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because

Re: How to include a button which links to a view?

2010-02-12 Thread Jeremy Burns
I agree, but sites must degrade nicely. With no java, the standard baked delete function deletes without warning. That is not nice degradation. If a site doesn't reorder a list without refreshing the page, that's OK. Jeremy Burns jeremybu...@me.com On 12 Feb 2010, at 10:20, WebbedIT wrote

Creating new rows

2010-02-12 Thread Jeremy Burns
I have this function in the items model: function addNewItem() { $this-save(); $itemId = $this-id; return $itemId; } When called from a controller it does what it is supposed to do; creates a new row in the table and returns the id of the new row. Here's the odd

Re: How to include a button which links to a view?

2010-02-11 Thread Jeremy Burns
://book.cakephp.org/view/836/link and http://book.cakephp.org/view/835/image Jeremy Burns jeremybu...@me.com On 11 Feb 2010, at 09:36, sebb86 wrote: Hello, how can i create a button in a view, which links to another view? This is my code with a simple text link, but how can i this as a button

Re: How to include a button which links to a view?

2010-02-11 Thread Jeremy Burns
I struggled with this for while as I don't like relying on java being switched on. Here's an article I put together that borrows heavily from other contributors here. It might help. http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/ Jeremy Burns jeremybu...@me.com

SSL and https

2010-02-11 Thread Jeremy Burns
I am using the security component from app_controller. In some controllers I have this in my beforeFilter: if (in_array($this-params['action'], $action)): $this-Security-blackHoleCallback = 'forceSSL'; $this-Security-requireSecure(); else:

Re: Caching Elements

2010-02-10 Thread Jeremy
Yes, correct. My bad. On Feb 10, 2:51 am, majna majna...@gmail.com wrote: I think it's /tmp/cache/views, not  /tmp/cache/element On Feb 10, 1:53 am, Jeremy mayt...@gmail.com wrote: With some help... I figured out the problem.  I was using the file cache option and although the /tmp

Re: Caching Elements

2010-02-10 Thread Jeremy
. I have pasted the full code to my element here: http://bin.cakephp.org/view/11698566 On Feb 10, 8:35 am, Jeremy mayt...@gmail.com wrote: Yes, correct.  My bad. On Feb 10, 2:51 am, majna majna...@gmail.com wrote: I think it's /tmp/cache/views, not  /tmp/cache/element On Feb 10, 1:53 am

Re: Auth flash message LAYOUT ???

2010-02-09 Thread Jeremy Burns
Try something along these lines: $this-Session-setFlash (__ ('Message.', true), true, array('class' = 'flashError') ); Jeremy Burns jeremybu...@me.com On 9 Feb 2010, at 14:32, toka...@gmail.com wrote: Hi, I am trying to set

Caching Elements

2010-02-09 Thread Jeremy
Hi all. I have created an element that will interact with an external webservice. The webservice presents weather forecast data in XML and I am using my element code to parse the XML and render it on my site. The weather forecast service never updates their data more frequently than 1 hour, so I

Re: Caching Elements

2010-02-09 Thread Jeremy
was that the element directory was missing. Once I added it... everything started working as expected. On Feb 9, 10:13 am, Jeremy mayt...@gmail.com wrote: Hi all.  I have created an element that will interact with an external webservice.  The webservice presents weather forecast data in XML and I am

Re: save default values when $this-data['field'] is empty

2010-02-03 Thread Jeremy Burns
You could either add a hidden text field to the form or set $this-data['model']['field'] to the value in the controller before you do a save. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 3 Feb 2010, at 10:16, matzeh

Re: Find help for $this-set(compact())

2010-02-03 Thread Jeremy Burns
It's actually a php function: http://php.net/manual/en/function.compact.php Jeremy Burns jeremybu...@me.com On 3 Feb 2010, at 16:16, McScreech wrote: Hello, Where do I find the definition or explanation of '$this-set(compact ())' in the Cookbook or API? Thanx, DaveT. Check out

Re: validation strangeness

2010-02-03 Thread Jeremy Burns
in http://book.cakephp.org/view/75/Saving-Your-Data here. Sometimes I have found that the shape of the array is not what is expected. Jeremy Burns On 4 Feb 2010, at 04:25, cricket wrote: Oops. I messed up the call to validate(). But, when I do ... if ($this-User-create($this-data) $this-User

Re: Pagination: URL for last page

2010-02-02 Thread Jeremy Burns
echo $paginator-last(''); Jeremy Burns On 2 Feb 2010, at 17:11, Ragnis wrote: How can i go to the last page, if i don't know the count of items? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message

Re: need some help with a select

2010-02-01 Thread Jeremy Burns
try: $form-input('**fieldname**', array('empty' = true)); ...where **fieldname** is the field you want to display. This will give you a populated drop down but the first entry will be an empty row. Is this what you wanted? Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns

Re: disabling cache when a user is logged

2010-02-01 Thread Jeremy Burns
Could you use cake:nocache/cake:nocache in the right places? See http://book.cakephp.org/view/347/Marking-Non-Cached-Content-in-Views Jeremy Burns On 1 Feb 2010, at 12:36, Lorenzo Bettini wrote: the real problem is that beforeRender is not called if the page is present in the cache... any

Re: HtmlHelper does not like multiple URL parameters?

2010-01-28 Thread Jeremy Burns
Aren't those two outputs the same? Jeremy Burns On 28 Jan 2010, at 07:59, Johnny Cupcake wrote: My code (Cake 1.2.5): echo $html-url( array( 'controller' = 'users', 'action' = 'activate', '?' = array('e' = 'EMAIL', 'c' = 'CODE')), TRUE ); The output: http://localhost/index.php

Random question

2010-01-28 Thread Jeremy Burns
This might seem a bit random/basic but I thought I'd ask it anyway. I love using the html helper, but is there a performance hit (even teeny tiny marginal because that can compound up) when calling up the helper to echo $html-tag('p', 'Hello world') compared a vanilla with pHello world/p? Check

Re: Subdomains

2010-01-27 Thread Jeremy Burns
others. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 7 Jan 2010, at 18:11, Juan Luis Baptiste wrote: On Thu, Jan 7, 2010 at 12:22 PM, Jeremy Burns jeremybu...@me.com wrote: My hosting company do allow me to create

Re: bindModel

2010-01-27 Thread Jeremy Burns
Can I pose the question Why are you not defining associations in your models? They are incredibly powerful. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 27 Jan 2010, at 04:36, YS wrote: I am very new to cakephp and having

Re: Blog tutorial trouble...

2010-01-27 Thread Jeremy Burns
It might not be this, but I've done it in the past. Check that when you installed Cake you also copied over the .htacces files. They exist in the root, in /app and in /app/webroot. If these files are hidden it is easy to overlook them, especially the one in the root. Jeremy Burns On 27 Jan

Re: bindModel

2010-01-27 Thread Jeremy Burns
recommend adopting it wholeheartedly. Once you get to grips with it you'll love it. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 27 Jan 2010, at 15:31, yazan suleiman wrote: Thats a very good question. In fact, I am still

Re: Dynamic Navigations

2010-01-27 Thread Jeremy Burns
I got this working (although I have amended the model since but not updated this article - perhaps I should!). This might help as a starting place. http://www.jeremy-burns.co.uk/2009/11/cakephp-dynamic-navigation-bars/ Jeremy Burns On 27 Jan 2010, at 16:06, Dave wrote: I m trying to figure

Re: Best approach for Pages

2010-01-27 Thread Jeremy Burns
I built an 'about' controller with a function for each page, then used routing to remove the 'about' part from the url. Jeremy Burns On 28 Jan 2010, at 06:10, Dave wrote: I have to build a simple site, 5 pages but the tricky part seems to be the pages are index, about us, info, history

Re: scaffold isn't working

2010-01-26 Thread Jeremy Burns
If it isn't already there, try turning debug to 2 as this clears the model cache. You can find the setting, which looks like this: Configure::write('debug', 2); ...in app/config/core.php Jeremy Burns On 26 Jan 2010, at 14:47, andrei.b wrote: Hello, I have 2 tables: authors(id, name, email

Re: Table Joins

2010-01-26 Thread Jeremy Burns
Table joins take place in the model using the $belongsTo, $hasMany and $hasAndBelongsToMany variables. See http://book.cakephp.org/view/78/Associations-Linking-Models-Together. Jeremy Burns On 27 Jan 2010, at 06:31, Uresh wrote: Hi...I am Uresh Patel from india. I am cakephp beginner. I

Deep nested data in forms

2010-01-25 Thread Jeremy Burns
I have some connected models: e.g. (made up example): Post-Comment-Author-Address My controller's index action creates an array using a model find function using the containable behaviour - let's call the output $postSummary. I have a form that displays data from across the $postSummary array:

Re: create a link with conditions to filter index action

2010-01-14 Thread Jeremy Burns
your data extraction. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 14 Jan 2010, at 10:47, nyahoo wrote: Hi All, I hope someone can help me with what I think is a simple question that I just haven't wrapped my head round

Re: Pagination with 2nd order recursive conditions filter

2010-01-10 Thread Jeremy Burns
. Of course, you can also add id fields into the results to allow the filtering you need. Has anyone got any views on this? Jeremy Burns On 10 Jan 2010, at 17:54, loke wrote: I am facing the exact same problem. I want to filter the results on the basis of a one-to-many relationship

Re: cakephp foreach

2010-01-08 Thread Jeremy Burns
It works just as in straightforward php: foreach ($array as $key): echo $key; endforeach; On 8 Jan 2010, at 08:01, Mann da wrote: i want help about foreach in cakephp, thanxs Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related

Subdomains

2010-01-07 Thread Jeremy Burns
I have a site that runs CakePHP (accessed via www.[domain].com). I now want to install Mantis bug tracker on a subdomain on the same site. So if I type mantisbt.[domain].com it takes me to Mantis rather than to the normal web root - and therefore does not fire up the Cake site. What settings do I

Re: Subdomains

2010-01-07 Thread Jeremy Burns
So if its running on a shared hosting package that doesn't allow virtual hosts I can't do this? On Jan 7, 2:35 pm, Juan Luis Baptiste juan.bapti...@gmail.com wrote: On Thu, Jan 7, 2010 at 9:31 AM, Jeremy Burns jeremybu...@me.com wrote: I have a site that runs CakePHP (accessed viawww.[domain

Re: Subdomains

2010-01-07 Thread Jeremy Burns
something to with .htaccess or something - an area I am hideously bad at. On 7 Jan 2010, at 17:18, Juan Luis Baptiste wrote: On Thu, Jan 7, 2010 at 9:44 AM, Jeremy Burns jeremybu...@me.com wrote: So if its running on a shared hosting package that doesn't allow virtual hosts I can't do

Re: setFlash() appending a 1

2010-01-06 Thread Jeremy Burns
How are you setting and displaying the flash value? Consider both an instruction, so if you do something like if($this-Session-flash()); you'll get both the message and a 1 to indicate success. To set the value, use $this-Session-setFlash();. To display it, use $this- Session-flash();. On Jan 7,

Re: How do I use the email component?

2010-01-05 Thread Jeremy Burns
Here you go - this covers the basics. Using the component is actually quite simple: http://www.jeremy-burns.co.uk/2009/12/cakephp-sending-email-using-the-email-component/ On Jan 5, 1:47 am, otisjs01 jerem...@jeremiahotis.com wrote: Hello, I am new to CakePHP and trying desperately to learn!

Re: How can I get an option/select drop down to populate with a table.myfield instead of the table.id (primary key).

2010-01-05 Thread Jeremy Burns
What you have here looks correct, except that your $belongsTo definition in your State model looks wrong. Shouldn't that be a $hasMany definition? That means that an Employee belongs to a State, and a State has many Employees. The drop down is displayed in a view and the contents of the drop down

Re: Count column in index view

2010-01-05 Thread Jeremy Burns
One more issue that has deflated my initial euphoria... The results don't paginate. How can I rectify that? On Jan 2, 4:53 am, Jeremy Burns jeremybu...@me.com wrote: A success! Using your self created join code I arrived at this:       $results = $this-LocationType-find(          'all

Re: How to add a column to the table after it is baked.

2010-01-02 Thread Jeremy Burns
The first place to start is by setting the debug level. In app/config/ core.php find the line that looks like this: Configure::write('debug', 2); ...and ensure the number is 1 or higher (2 is good). Then visit your view again. When the debug level is 1 or higher, Cake refreshes its model cache.

Re: $this-Session-setFlash();

2010-01-01 Thread Jeremy Burns
Hi Dave Here's how you can do it: $this-Session-setFlash(__('Your message.', true), true, array ('class' = 'yourClass')); On Jan 2, 2:35 am, Dave make.cake.b...@gmail.com wrote: I was wondering is there a way to add a class to the session from the controller? The setflash as far as i can

Re: Count column in index view

2010-01-01 Thread Jeremy Burns
solution! Enjoy,    John On Dec 30, 12:07 pm, Jeremy Burns jeremybu...@me.com wrote: Thank you John - I will try this out. Strikes me as very odd that this is not much much simpler! On Dec 30, 10:05 am, John Andersen j.andersen...@gmail.com wrote: Hi Jeremy, Seems like Contain

Re: Count column in index view

2010-01-01 Thread Jeremy Burns
I have changed my code slightly from: $results = $this-LocationType-Location-find( to $results = $this-LocationType-find( This does not error, but only produces the location_types that have locations. Therefore the results are still incomplete. On Jan 2, 4:45 am, Jeremy Burns jeremybu...@me.com

Re: Count column in index view

2010-01-01 Thread Jeremy Burns
) as location_count'), 'group' = array('LocationType.id', 'LocationType.name'), ) ); ...which works. Still seams long handed to me though. On Jan 2, 4:49 am, Jeremy Burns jeremybu...@me.com wrote: I have changed my code slightly from: $results = $this-LocationType-Location-find

Re: Count column in index view

2009-12-30 Thread Jeremy Burns
Thank you John - I will try this out. Strikes me as very odd that this is not much much simpler! On Dec 30, 10:05 am, John Andersen j.andersen...@gmail.com wrote: Hi Jeremy, Seems like Contain can't find out to make a join when there is a hasMany relationship between the Author

Re: Count column in index view

2009-12-29 Thread Jeremy Burns
Any takers for this please? On Dec 23, 6:01 am, Jeremy Burns jeremybu...@me.com wrote: I have progressed a little with this, but am still struggling. I seem to get hung up on the simplest of things with CakePHP, which is so frustrating. I am prepared to be humiliated with an equally simple

Re: Count column in index view

2009-12-29 Thread Jeremy Burns
columns, which it should, like: 'group' = array(    'LocationType.id',    'LocationType.name',    'LocationType.parent_id',    'ParentLocationType.id',    'ParentLocationType.name' ), Please try it out, enjoy,    John On Dec 23, 8:01 am, Jeremy Burns jeremybu...@me.com wrote: I have

Re: Count column in index view

2009-12-29 Thread Jeremy Burns
Thanks John. Option B does indeed work - sort of! It returns a list of location types with a count of their locations, but only where there is a location. In other words, it does not give me the location types that do not have have any locations. Any more ideas - anyone? On Dec 29, 12:35 pm,

Re: Adaptive pagination

2009-12-23 Thread Jeremy Burns
This isn't a full answer but will hopefully help your thinking. You could build a custom element that includes some logic around the current page, which is reached via $paginator-current(). You could then build links to the previous (say) five pages and the next five pages, with some logic to

Re: Count column in index view

2009-12-22 Thread Jeremy Burns
jamalsaepula...@gmail.com wrote: Hi Jeremy, I think you can do that in your model with afterFind callback. For example: class MyModel extends AppModel{         var $actsAs = array('Tree');         function afterFind($results, $primary){                 // for multiple result

Re: Count column in index view

2009-12-22 Thread Jeremy Burns
) is not recognised. I have experimented with various permutations by changing the group array and the field inside the COUNT () function, but I cannot get the result I am looking for. What am I doing wrong, please? On Dec 22, 11:04 am, Jeremy Burns jeremybu...@me.com wrote: Jamal - I really appreciate your

Re: Count column in index view

2009-12-21 Thread Jeremy Burns
. Happy Christmas. On Dec 18, 10:33 am, Jeremy Burns jeremybu...@me.com wrote: I have a model that uses the Tree behaviour, so it has a self join in the database (parent_id to id). In my index view I'd like to add a column that shows the count of direct children for 'this' row. I know I can get

Count column in index view

2009-12-18 Thread Jeremy Burns
I have a model that uses the Tree behaviour, so it has a self join in the database (parent_id to id). In my index view I'd like to add a column that shows the count of direct children for 'this' row. I know I can get that number on a row by row basis using childCount, but how do I use that as part

Re: Not showing timestamp field

2009-12-17 Thread Jeremy Burns
Cake can handle this quite nicely (and invisibly too). Add a datetime field called 'created' to your users table - and that's about it really. Don't include it in the add form. Cake will detect it (make sure you turn debugging to 2 at least once to make sure the model cache is refreshed to include

Re: Blog Video

2009-12-16 Thread Jeremy Burns
I always had problems getting to these. By poking around in the page source you'll find where they are stored, for example: http://www.archive.org/download/SettingUpTheCakephpConsoleOnnix/ They run quite well from there. On Dec 16, 4:17 pm, Sam Sherlock sam.sherl...@gmail.com wrote: The

Routing with named parameters

2009-12-16 Thread Jeremy Burns
In routes.php file, I have this entry: Router::connect('/:controller/add', array('action' = 'edit', 'origAction' = 'add')); ...which works great. It sends all add requests to the edit functions and sets a variable called origAction to add where appropriate (this is taken from Matt Curry's

Re: Routing with named parameters

2009-12-16 Thread Jeremy Burns
) { ..and then I can refer to $parameter On Dec 17, 5:50 am, Jeremy Burns jeremybu...@me.com wrote: In routes.php file, I have this entry: Router::connect('/:controller/add', array('action' = 'edit', 'origAction' = 'add')); ...which works great. It sends all add requests to the edit functions

Re: Migration Guide 1.2 to 1.3

2009-12-15 Thread Jeremy Burns
I have only worked with 1.2.5, so haven't done a migration yet. It seems sensible to develop in 1.3 beta. If I migrate current development work onto 1.3 beta, what will the migration to 1.3 final be like? Is it worth it, or should I wait in order to avoid duplication of effort? On Dec 14, 5:55 

Re: Ajax form submit issue

2009-12-15 Thread Jeremy Burns
' = '', 'action' = 'view', $this-Xxxx-id)); ...solves the issue. I am surprised that more people don't run into this issue. On Dec 14, 2:07 pm, Jeremy Burns jeremybu...@me.com wrote: I have a problem that is driving me mad! I have a form that submits data to an edit action. It works fine when

Re: Migration Guide 1.2 to 1.3

2009-12-15 Thread Jeremy Burns
and migrated. There wont be a big difference between beta and final besides internal code. On Dec 15, 1:56 am, Jeremy Burns jeremybu...@me.com wrote: I have only worked with 1.2.5, so haven't done a migration yet. It seems sensible to develop in 1.3 beta. If I migrate current development work

Ajax form submit issue

2009-12-14 Thread Jeremy Burns
I have a problem that is driving me mad! I have a form that submits data to an edit action. It works fine when using $form-submit. I want to submit the form via Ajax. If I change the form submit button to the following: $ajax-submit ( 'Save', array( 'div' = false,

Re: Create .ctp file

2009-12-13 Thread Jeremy Burns
Start of the second paragraph: http://book.cakephp.org/view/95/View-Templates On Dec 13, 3:11 pm, 00Cake olivier.levall...@gmail.com wrote: Altight, Thank you guys... As I was telling if you don't know zhat is a .ctp extension file, you are not suppose to know that it is a html/php file

Testing for Ajax

2009-12-10 Thread Jeremy Burns
I want to use the Ajax helper when Javascript is enabled, but revert to the plain old ordinary html helper when it is not. How can I do a simple test to see if Javascript is enabled? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

Re: Database field not reading or writing

2009-12-10 Thread Jeremy Burns
This might not be the answer, but the first I do when I get a db related issue is set debug to 2 and try again. Sometimes cleaning the caches like this resolves it, other times not. On Dec 10, 2:42 pm, WhyNotSmile sharongilmor...@googlemail.com wrote: I've come across a really strange problem -

Re: Testing for Ajax

2009-12-10 Thread Jeremy Burns
. On Dec 10, 6:58 pm, Jeremy Burns jeremybu...@me.com wrote: I want to use the Ajax helper when Javascript is enabled, but revert to the plain old ordinary html helper when it is not. How can I do a simple test to see if Javascript is enabled? Check out the new CakePHP Questions site

Re: Testing for Ajax

2009-12-10 Thread Jeremy Burns
Thank you - I don't suppose you have a simple example do you? On Dec 11, 4:12 am, Dr. Loboto drlob...@gmail.com wrote: Pass one URL to AJAX link as link url and other to it's options as AJAX action param. On Dec 10, 11:37 pm, Jeremy Burns jeremybu...@me.com wrote: Thank you

Function exists

2009-12-09 Thread Jeremy Burns
I want to call a function in a controller from my app_controller, but want to check it exists first. I've fiddled around with function_exists but can't get the syntax right. This is the current version of the code (which doesn't work): function getRelations($id = null) { if

Re: Function exists

2009-12-09 Thread Jeremy Burns
j.andersen...@gmail.com wrote: Hi Jeremy Try to use the class/object method method_exists instead! Definition: method_exists -- Checks if the class method exists Description bool method_exists ( object object, string method_name) This function returns TRUE if the method given by method_name

Re: Get natural SQL built by Model methods like find, save

2009-12-08 Thread Jeremy Burns
Do you have the following: Configure::write('debug', 2); in your /app/config/core.php file? If so, you ought to be seeing a complete list of all SQL run at the foot of the page. On Dec 8, 10:46 am, Manish Pithwa cis.man...@gmail.com wrote: Hi All, Sometimes we want to see what query CakePHP

Re: Calling function within a controller

2009-12-08 Thread Jeremy Burns
Try: $this-accept($id); On Dec 8, 4:54 pm, WhyNotSmile sharongilmor...@googlemail.com wrote: This may be really dumb, but I'm having trouble calling a function from within a controller.  Here's my set up: function accept_this($id = null) {    ... some bits of code ...    $result =

Re: Delete confirm

2009-12-07 Thread Jeremy Burns
I now have this working just as I wanted it. See here: http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/ On Dec 1, 10:07 am, jburns jeremybu...@me.com wrote: Thanks for the reply. I guess it is a tad unreasonable to expect two year old code to 'just work'! I just

Re: Does redirect clear variables?

2009-12-07 Thread Jeremy Burns
the function all variables needed by the view are prepared by the the view function in the controller and rendering the view displays it as expected. For full details see here: http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/ On Dec 5, 9:16 am, Jeremy Burns jeremybu...@me.com

Re: Permission denied page instead of login page

2009-12-07 Thread Jeremy Burns
I don't for a minute think I have the answer but would hate you to feel too lonely! This is just a wild suggestion and I apologise if it's totally wrong. Have you thought about changing your $this-Auth- loginAction to point to your Permission denied page? Then if someone does something that needs

Re: Does redirect clear variables?

2009-12-05 Thread Jeremy Burns
for that session only a redirect even to the same url starts the whole process again use session, file cache, or pass them with your redirect url (depending on the kind of information and how much it is) On 4 Dez., 13:59, Jeremy Burns jeremybu...@me.com wrote: I am setting a variable

Re: Noob having problems getting started.

2009-12-05 Thread Jeremy Burns
Your directory structure doesn't look right. The directory 'cakephp' is effectively the root of your site. The files/folders within it should be: .htaccess /app /cake /docs (optional, but useful) index.php /vendors All of the files and folders that you create go in the /app folder. If you follow

Does redirect clear variables?

2009-12-04 Thread Jeremy Burns
I am setting a variable using $this-set('name', value), and then redirecting the user to a different page using $this-redirect(array ('action' = 'index'), null, true);. The variable $name is no longer recognised. Does a redirect clear the set variables? If so, how can I pass the variable along to

Re: Any chance to get the ID of a new created record BEFORE I save it to the DB?

2009-12-03 Thread Jeremy Burns
Have you considered an approach where you save A and B independently (i.e. without worrying about the connecting ids), collecting the ids of both A and B (using $this-A-id immediately after save) and then doing a subsequent update? On Dec 3, 7:54 am, Quess miroslaw.niepo...@gmail.com wrote:

Re: Any chance to get the ID of a new created record BEFORE I save it to the DB?

2009-12-03 Thread Jeremy Burns
I forgot to add... If the insert of B fails, you can delete A because you know the id of the most recently added row in A. On Dec 3, 8:32 am, Jeremy Burns jeremybu...@me.com wrote: Have you considered an approach where you save A and B independently (i.e. without worrying about the connecting

Re: modifying baked sources

2009-12-03 Thread Jeremy Burns
        Lore Jeremy Burns wrote: I guess there are two approaches. 1. Rename the model/views/ controllers before you bake, then do a comparison and merge afterwards. 2. Once you have the initial bake complete, just amend the files rather than re-baking. This has the advantage

Re: Delete confirm

2009-12-03 Thread Jeremy Burns
I thought it might be about time to jot down how I am implementing this (based around AD7Six's code). I have got it working *pretty much* as I want it, but still have a few questions. I never thought this would be so tough! I readily acknowledge that I am stumbling in the dark here at times.

Re: what does it mean to bake something

2009-12-03 Thread Jeremy Burns
Bake just gets you started really. If you follow the instructions in the online guide you'll be able to create basic models, controllers and views for the tables in your database. The results are pretty good, but not what you'd want to go live with. If you are learning your way around Cake it's a

Re: modifying baked sources

2009-12-02 Thread Jeremy Burns
I guess there are two approaches. 1. Rename the model/views/ controllers before you bake, then do a comparison and merge afterwards. 2. Once you have the initial bake complete, just amend the files rather than re-baking. This has the advantage of helping you learn as well. On Dec 2, 6:23 pm,

Re: How to get two input fields in same line?

2009-12-02 Thread Jeremy Burns
You could also do this: ?php echo $form-input('User.name', array('div' = false));? You could do your own surrounding div, then two inputs with div = false; in other words, take case of the divs yourself. On Dec 3, 5:46 am, anand angadi anuang...@gmail.com wrote: Hi, This may help you...

Re: Help accessing array from HABTM relationship

2009-12-02 Thread Jeremy Burns
I have spread your array out so I can see its layout. I *think* you'd need to do a foreach loop on users too. On Dec 3, 12:02 am, Casmit chav...@gmail.com wrote: I have a table called Group that has a HABTM relationship to table Points.  Group also has a HABTM relationship to Users.  

Re: Delete confirm

2009-11-16 Thread Jeremy Burns
doesn't have a 'delete' function in it as I am using the generic delete function in the app_controller. What am I doing wrong? Jeremy Burns On 13 Nov 2009, at 15:44, AD7six wrote: On 13 nov, 16:30, jburns jeremybu...@me.com wrote: No responses on this - any takers? Try

Re: Delete confirm

2009-11-14 Thread Jeremy Burns
Thanks to everyone for their input. ADsix's post is indeed comprehensive and I am just picking my through it now. I will post back my final implentation here. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 14 Nov 2009, at 12

Re: How set other fieldname for parent_id in Tree Behavior

2009-11-13 Thread Jeremy Burns
Try this: var $actAs = array('Tree' = array('parent_id' = '[new_field_name]')); Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 13 Nov 2009, at 15:12, Aldo wrote: I already did, but was not able to find an answer to my

Re: Where should this code go?

2009-11-13 Thread Jeremy Burns
Thanks - can a helper interrogate the database (which is a key requirement)? Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 13 Nov 2009, at 15:37, Marcelo Andrade wrote: On Fri, Nov 13, 2009 at 12:25 PM, jburns jeremybu

Re: Where should this code go?

2009-11-13 Thread Jeremy Burns
Yup - I've got that, but the data I want to access is outside of the current MVC - it's navigation based so data so system wide. I'd call this function from just about every MVC, so want to put it in one place (DRY). Jeremy Burns jeremybu...@me.com On 13 Nov 2009, at 15:47, Marcelo Andrade

Re: Delete confirm

2009-11-13 Thread Jeremy Burns
Thanks very much - I'll do some reading. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 13 Nov 2009, at 15:44, AD7six wrote: On 13 nov, 16:30, jburns jeremybu...@me.com wrote: No responses on this - any takers? Try

Re: Delete confirm

2009-11-13 Thread Jeremy Burns
Thanks - good approach. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 13 Nov 2009, at 15:44, Marcelo Andrade wrote: On Fri, Nov 13, 2009 at 4:14 AM, jburns jeremybu...@me.com wrote: I am not happy with the javascript delete

Re: **Various** issues with extended characters.

2009-11-12 Thread Jeremy Burns
A quick idea. Have you set the charset in your layout or is it still using the defaults? See http://book.cakephp.org/view/96/Layouts and then the html helper - http://book.cakephp.org/view/830/charset. Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949

Re: using jquery with cakephp

2009-08-19 Thread jeremy
am able to do the client side validation using jquery... but is having difficulty in implementing server side validations... so if there is a tutorial on how to use this, i suppose it would be very helpful.. thank you --~--~-~--~~~---~--~~ You received

Tutorials on implementing server side validation in cakephp using jquery

2009-08-19 Thread jeremy
hai guys, i am looking for tutorials on using cakephp with jquery to implement the server side validations... please send me the links..as am not able to find a proper subject in this material Thamks in advance.

using jquery with cakephp

2009-07-30 Thread jeremy
hai guys, am looking for using jquery with cakephp... i googled a lot but didnt get appropriate tutorials for this can anyone send me links or tutorials of perfroming both the client side and server side validations in cakephp using jquery.. THANZ IN ADVANCE

Re: Retreiving values from Jquery to a controller in cakephp

2009-07-15 Thread jeremy
hai can anyone tell me how can i get the posted values from jquery to a controller so far this problem has not been solved.. my jquery alerts correctly as shown in the above disucssion now its the only problem of how to get this values to a controoler in cakephp any refrence or examples

Re: Retreiving values from Jquery to a controller in cakephp

2009-07-13 Thread jeremy
hai guys am waiting didnt get any response so far... please help me as i need to get this working.. my javascript file is as shown below $(document).ready(function() { var value = $('.add-beer-link').attr('id');

Retreiving values from Jquery to a controller in cakephp

2009-07-07 Thread jeremy
hai guys am new to this cakephp stuff and is having problem using cakephp with jquery... my problem is that am not able to get the values posted from jquery to a controller in php... my controller file is simple and is given below... users_controller.php == ?php class

Re: Error on line 525 in Security Component

2008-07-21 Thread Jeremy Hicks
Can you give more details about what you had to do to fix this? On Sun, Jul 20, 2008 at 2:24 PM, Mathachew [EMAIL PROTECTED] wrote: I found out what the issue was. I was trying to use the security component without creating all form items in the form helper. On Jul 19, 7:19 pm, Mathachew

Re: search only entered fields

2007-07-09 Thread Jeremy David Pointer
Unless someone has a better idea what about: (p.s. didn't test this so read it as pseudo code) foreach ($sonditions as $field=$value ) { if(!empty($value)) $arrconditions[$field]=$value; } findAll($arrconditions, hashkash wrote: Hi! I searched the group for my problem

Re: search only entered fields

2007-07-09 Thread Jeremy David Pointer
Minor corrections below Unless someone has a better idea what about: (p.s. didn't test this so read it as pseudo code) foreach ($sonditions['Equipment'] as $field=$value ) { if(!empty($value)) $arrconditions['Equipment.'.$field]=$value; } findAll($arrconditions, hashkash wrote:

<    12   13   14   15   16   17   18   >