Re: Is it possible to get a query and display it to views/layouts/default.ctp? Cake 1.3?

2011-03-10 Thread Greg Skerman
Use an element. You could store the cart contents in a cookie or session and save the hit on the db as well if you wanted to... On Wednesday, September 29, 2010, Louie Miranda wrote: > Hi, > > I have this shopping cart where I am trying to figure out how can I display a > query (example numbers

Re: cakephp shared hosting question

2011-03-10 Thread thatsgreat2345
You said you wanted to have the website be example.com/exceltv so what you can do is put webroot in public_html then just rename it to exceltv (the files inside webroot will now be in a folder called exceltv in public_html) On Mar 9, 8:19 pm, Tan Cheng wrote: > Thanks for your help. > > I have a

cakephp 2.0 will be like this to save the data?

2011-03-10 Thread cake-learner
I hope we can do this oop way pretty soon to save data not the array( which cost me a lot of time to debug ) $obj = new myObject(); $obj -> name = 'myname'; $obj -> save(); $obj = myObject::load(id); $obj -> save(); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakeph

Re: cakephp shared hosting question

2011-03-10 Thread rethab
Find more information about the advanced setup here: http://book.cakephp.org/#!/view/915/Advanced-Installation cheers On 10 Mrz., 09:31, thatsgreat2345 wrote: > You said you wanted to have the website be example.com/exceltv so what > you can do is put webroot in public_html then just rename it t

CSS help

2011-03-10 Thread dunny
Is there a way to add epoch to the end of the css file like so: http://example.com/my.css?1299749966 using the Html helper? Its helpful to force a request of the newer css, or so I heard. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new Cake

Error Security::cipher()

2011-03-10 Thread Carachi
Hello, I try to use the Cookie component but I have this problem: I write the cookie in controller1 so: $this->Cookie->write($name, $value ,true, $time); and try to read this cookie from an other controller, controller2, so: $this->Cookie->read($name); but when i call this functio

Re: CSS help

2011-03-10 Thread Sam Sherlock
I think its called asset timestamping see the htmlhelper for examples works on img,css and js On 10/03/2011, dunny wrote: > Is there a way to add epoch to the end of the css file like so: > http://example.com/my.css?1299749966 > using the Html helper? Its helpful to force a request of the newer c

Please help with Optional Search Field

2011-03-10 Thread Mr.Jayesh
I am in process of creating a search function for my site. It has three search parameters. I have worked it this way. The search functions properly with pagination. The problem is small; I am not able to identify how to set optional field. When a user passes all the parameters for search there is n

Re: Error Security::cipher()

2011-03-10 Thread rethab
have you checked what's the value of the parameters? e.g. by using the function debug On 10 Mrz., 11:23, Carachi wrote: > Hello, > I try to use the Cookie component  but I have this problem: > I write the cookie in controller1 so: >         $this->Cookie->write($name, $value ,true, $time); > and

Re: Problems in saving form data to database

2011-03-10 Thread rethab
why not omitting the index 'Post' as well? On 10 Mrz., 07:29, Jeremy Burns | Class Outfit wrote: > This line looks wrong: > > if ($this->Post->save($this->data['Post']['user_id']) == true) { > > Try: > > if ($this->Post->save($this->data['Post']) == true) { > > Jeremy Burns > Class Outfit > > jer

Re: Problems in saving form data to database

2011-03-10 Thread Jeremy Burns | Class Outfit
Yup - you can do that. Jeremy Burns Class Outfit jeremybu...@classoutfit.com (t) +44 (0) 208 123 3822 (m) +44 (0) 7973 481949 Skype: jeremy_burns http://www.classoutfit.com On 10 Mar 2011, at 12:14, rethab wrote: > why not omitting the index 'Post' as well? > > On 10 Mrz., 07:29, Jeremy Burns

Re: Problems in saving form data to database

2011-03-10 Thread goluhaque
I know, I know, we can just do the $this->data part, but that doesn't work too. On Mar 10, 5:16 pm, Jeremy Burns | Class Outfit wrote: > Yup - you can do that. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.com > (t) +44 (0) 208 123 3822 > (m) +44 (0) 7973 481949 > Skype: jeremy_burn

Re: Problems in saving form data to database

2011-03-10 Thread Jeremy Burns | Class Outfit
What is the name of your Post model file? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 10 Mar 2011, at 12:22, goluhaque wrote: > I know, I know, we can just do the $this->data part, but that doesn't > work too. > > On Mar 10, 5:16 pm, Jeremy Burns | Class

Re: Problems in saving form data to database

2011-03-10 Thread Afzalul Haque
post.php On Thu, Mar 10, 2011 at 5:54 PM, Jeremy Burns | Class Outfit < jeremybu...@classoutfit.com> wrote: > What is the name of your Post model file? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.com > http://www.classoutfit.com > > On 10 Mar 2011, at 12:22, goluhaque wrote: > > >

Re: Problems in saving form data to database

2011-03-10 Thread Alejandro Gómez Fernández
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Do you read the database log? The web server log? Sometimes this happend when there is a data type "error" in the database. Regards, Alejandro Gómez Fernández El 10/03/2011 09:22, goluhaque escribió: > I know, I know, we can just do the $this->dat

Re: Problems in saving form data to database

2011-03-10 Thread Afzalul Haque
Haven't checked that one yet. Will do. Thanks. 2011/3/10 Alejandro Gómez Fernández > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > Do you read the database log? The web server log? > Sometimes this happend when there is a data type "error" in the database. > Regards, > > > Alejandro Góme

Editor for Comments

2011-03-10 Thread Chris
Hi there, I came to the idea that a real simple plain editor would be great for the commenting system I just built. Can anybody recommend one? I saw markitup! but it seems to be too much for my needs. What I want is a rather simple functionality, like the comment box you can find on youtube, which

image layout cant be seen after installation

2011-03-10 Thread cake_beginner
i dont know what's the problem, i downloaded cake 1.3 on my desktop, then unzip it to my opt/lampp/htdocs/example change the config folder, database.php, core.php (salt, cipherSeed) sudo chmod -R 777 sudo a2enmod rewrite and that's all i did.. i access it at localhost/example, and its running sm

Re: Please help with Optional Search Field

2011-03-10 Thread rethab
What is the exact error message you're facing? Maybe something like: 'Use of undefined variable'? Some of your variables are only set if the if - statements execute. However, you're using them later on. Make sure you either initialise them with default values or don't use them below. On 10 Mrz.,

Re: image layout cant be seen after installation

2011-03-10 Thread rethab
Does look like mod_rewrite was not activated. Did you check the activated modules on your server? On 10 Mrz., 06:41, cake_beginner wrote: > i dont know what's the problem, > i downloaded cake 1.3 on my desktop, > then unzip it to my opt/lampp/htdocs/example > > change the config folder, database.

Re: Editor for Comments

2011-03-10 Thread rethab
You might want to use this PHP function: http://ch.php.net/manual/de/function.nl2br.php As for WYSIWYG Editors: I thought TinyMCE could be used pretty light- weight cheers On 9 Mrz., 23:09, Chris wrote: > Hi there, > > I came to the idea that a real simple plain editor would be great for > the

Re: image layout cant be seen after installation

2011-03-10 Thread Shaz
http://book.cakephp.org/#!/view/917/Apache-and-mod_rewrite-and-htaccess On Mar 10, 2:24 pm, rethab wrote: > Does look like mod_rewrite was not activated. Did you check the > activated modules on your server? > > On 10 Mrz., 06:41, cake_beginner wrote: > > > i dont know what's the problem, > > i

Re: image layout cant be seen after installation

2011-03-10 Thread scs
I would suggest to look and make sure your .htaccess files are copied over. If you have your server setup to not allow .htaccess files go in the core.php file and make the adjustment for that. On Mar 10, 8:24 am, rethab wrote: > Does look like mod_rewrite was not activated. Did you check the > a

Re: cakephp shared hosting question

2011-03-10 Thread Tan Cheng
Thanks for the article, I'm reading it. On Mar 10, 3:49 am, rethab wrote: > Find more information about the advanced setup > here:http://book.cakephp.org/#!/view/915/Advanced-Installation > > cheers > > On 10 Mrz., 09:31, thatsgreat2345 wrote: > > > > > > > > > You said you wanted to have the w

Re: How to validate multiple fields with the same name?

2011-03-10 Thread Shaz
Sounds like a challenge! The only way I can think of is to write a custom validation rule that checks each of the submitted Product Names - have a read at: http://book.cakephp.org/#!/view/1179/Custom-Validation-Rules Let us know how you get one! Might be handy in the future... On Mar 9, 2:30 am,

Re: HABTM: has a related data

2011-03-10 Thread Shaz
Have you tried $this->Lot->paginate() ? Just seems like you're skipping the relationship if you're trying to paginate 'Lot' in 'Watches'? On Mar 7, 11:44 am, Angelo wrote: > Hello, > > I have a big problem, i've got the following structure: > > var $hasAndBelongsToMany = array( > >           'Ref

Re: HABTM: has a related data

2011-03-10 Thread Shaz
Have you tried $this->Lot->paginate() ? Just seems like you're skipping the relationship if you're trying to paginate 'Lot' in 'Watches'? On Mar 7, 11:44 am, Angelo wrote: > Hello, > > I have a big problem, i've got the following structure: > > var $hasAndBelongsToMany = array( > >           'Ref

Re: Error Security::cipher()

2011-03-10 Thread Carachi
HI rethab thank you. How can I do function debug?? Thank you On 10 Mar, 13:00, rethab wrote: > have you checked what's the value of the parameters? e.g. by using the > function debug > > On 10 Mrz., 11:23, Carachi wrote: > > > > > > > > > Hello, > > I try to use the Cookie component  but I have

TDD Curiosity

2011-03-10 Thread Shaz
Just a random thought - I've been helping a friend get to grips with cake and I know later on he *needs* to be introduced to test-driven development;; wouldn't it be more interesting it to teach the methodologies the other way around? For example, the first thing he would ever write would be a test

Re: Editor for Comments

2011-03-10 Thread Shaz
http://ckeditor.com/ - I have a minimalist version of it working on a few of my cakePHP websites. On Mar 10, 2:22 pm, rethab wrote: > You might want to use this PHP > function:http://ch.php.net/manual/de/function.nl2br.php > > As for WYSIWYG Editors: I thought TinyMCE could be used pretty light-

Problem with encoding UTF-8

2011-03-10 Thread Djonatan Buss
I'm trying to set my application to run under UTF-8 encoding. I've setted : config/database.php 'encoding' => 'utf8' config/core.php Configure::write('App.encoding', 'UTF-8'); views/layouts/*.ctp charset(); ?> And my netbeans project was created as an UTF-8 proj

Re: Mobile Phone Layout - Using the RequestHandler in the CakeErrorController / AppError

2011-03-10 Thread Sam Bernard
Take a look at this link- http://deadlytechnology.com/php/api-error-handling/ Basically it shows how to create a custom errorhandler including the ability to access the requeshandler(using $this->controller->RequestHandler). Make sure you read the comments if you have any issues implementing it.

Re: search function results

2011-03-10 Thread Sam Bernard
What error are you getting? %20 is just a urlencoded space... it isn't an error. If you want to replace it with a space then just do your str_replace on your $url var right before "$this->redirect($url);". -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Ch

Re: How to validate multiple fields with the same name?

2011-03-10 Thread Sam Bernard
You *should* be able to do this with "saveAll". saveAll will validate your records and then try to save all the records in a single transaction, so you don't have to validate first and then perform a transaction. If for some reason you wanted to validate separately- just do: $this-> Product->sav

Re: HABTM: has a related data

2011-03-10 Thread Sam Bernard
Paginate is a controller function, not a model function- so you can't call it on the model. I'm a little confused as to what you are trying to do- what controller are you trying to paginate your "Lot" records from? Also, have you read the cookbook section on pagination? http://book.cakephp.org/

Re: cakephp shared hosting question

2011-03-10 Thread Tan Cheng
Hi everyone, It seems like I kind of solved this problem. Thanks to everyone's help, I learned a lot through the process. Just in case anybody is having similar issue, here is what I did, I'm really a novice, so I can't explain why every step is necessary, but it works for me: 1) I followed a yo

Re: Error Security::cipher()

2011-03-10 Thread rethab
Hi you I meant that one: debug($name); Because it looks to me as if one of your parameters was empty cheers On 10 Mrz., 15:06, Carachi wrote: > HI rethab > thank you. > How can I do function debug?? > > Thank you > > On 10 Mar, 13:00, rethab wrote: > > > have you checked what's the value of t

Building spell check into forms

2011-03-10 Thread chris
I realise that this isn't stictly a cakePHP question. But as I'm building my application in cakePHP, I just wanted to see if anyone had any advice in the area. I have a requirement to provide a spell check functionality in some of my forms. The input fields are simple 'textarea' fields. Looking a

Re: Error Security::cipher()

2011-03-10 Thread Carachi
thank you rethab I try with debug function but I didn't understand the problem. Cakephp give this error: Warning (512): You cannot use an empty key for Security::cipher() [CORE/cake/libs/security.php, line 173] Code | Context function cipher($text, $key) { if (empty($key)) {

Re: Error Security::cipher()

2011-03-10 Thread rethab
I'm really not into that stuff but did you make sure all your parameters are not empty? (that's what I suggested the debug function for) cheers On 10 Mrz., 17:46, Carachi wrote: > thank you rethab > I try with debug function but I didn't understand the problem. > Cakephp give this error: > > War

RE: Editor for Comments

2011-03-10 Thread Krissy Masters
I use jwysiwyg, jQuery editor for basic html inserts. Simple and very very light. Odds are you do not need images and flash tables lists colors, various overloaded options for comments. Also remember you need to clean HTML data to prevent users from dropping in their own tags / scripts for example

Re: search function results

2011-03-10 Thread chris...@yahoo.com
Thank you for your response Sam,... In fact I did that,... another version to attempt... but now I'm not getting search results, but the page is clean on URL bar,... and yes its a urlencoded space %20 here is what I have... function search($name = null) { if(!empty($this->data)) {

Re: Problem with encoding UTF-8

2011-03-10 Thread Djonatan Buss
Seems to be something to do with /etc/apache2/conf.d AddDefaultCharset -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe fro

Re: Problem with encoding UTF-8

2011-03-10 Thread Djonatan Buss
Just to confirm, we had a .htaccess with the attribute AddDefaultCharset = ISO-8859-1 Then I added another .htaccess in this new project just turning it off AddDefaultCharset = Off -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Que

Re: Please help with Optional Search Field

2011-03-10 Thread Mr.Jayesh
Thanks for the response. As advised, I solved this by adding a else statement to it. now its working well. Another thing, would you please advice me a quick solution from which i can hide model name from my URL created out of search string. currently my url looks like: http://my.website.com/medica

Public opinion

2011-03-10 Thread Krissy Masters
What are your views on breaking up css files? 1 master css sheet vs many smaller specific variants? I am using asset helper so all css js is compressesed / minimized / and ends up being 1 file each. Just for this question take colorbox or fancy box css for example, its not a large file but

Re: Error Security::cipher()

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 11:46 AM, Carachi wrote: > thank you rethab > I try with debug function but I didn't understand the problem. > Cakephp give this error: > > > Warning (512): You cannot use an empty key for Security::cipher() > [CORE/cake/libs/security.php, line 173] > Code | Context >    fu

Re: Take id from autocomplete's data

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 1:36 AM, thom wrote: > On Wed, Mar 9, 2011 at 1:01 PM, thom wrote: >> Hello, >> >> I am learning CakePHP and now using Cake 1.3. I have a worked auto >> complete. I follow the instruction in the manual. The problem is, I'd >> like to take id from auto complete's data. What

Re: Editor for Comments

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 12:14 PM, Krissy Masters wrote: > I use jwysiwyg, jQuery editor for basic html inserts. Simple and very very > light. Odds are you do not need images and flash tables lists colors, > various overloaded options for comments. Also remember you need to clean > HTML data to pre

Re: search function results

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 12:27 PM, chris...@yahoo.com wrote: > Thank you for your response Sam,... > In fact I did that,... another version to attempt... but now I'm not > getting search results, but the page is clean on URL bar,... and yes > its a urlencoded space %20 > > here is what I have... >

RE: Editor for Comments

2011-03-10 Thread Krissy Masters
Would love to see the jwysiwyg element. I have HTMLpurifier set up already. Thanks, K -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. T

Re: Error Security::cipher()

2011-03-10 Thread Carachi
Thank you. after set I call this method: $this->Cookie->read('mycookie'); and it return this error: Warning (512): You cannot use an empty key for Security::cipher() if I call with debug function so: On Mar 10, 8:20 pm, cricket wrote: > On Thu, Mar 10, 2011 at 11:46 AM, Carachi wro

Re: Error Security::cipher()

2011-03-10 Thread Carachi
Thank you. after set I call this method: $this->Cookie->read('mycookie'); and it return this error: Warning (512): You cannot use an empty key for Security::cipher() if I call with debug function so: debug($this->Cookie->read('mycookie')); doesn't return anything... Thank you On

Re: Public opinion

2011-03-10 Thread Greg Skerman
I tend to like breaking my CSS up into various sheets... I have screen.css and print.css, as well as typography, forms and others. I personally find it much nicer easier to manage whilst designing the layouts. I also find it more flexible for doing specific things - if a page requires a totally d

Re: Error Security::cipher()

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 4:48 PM, Carachi wrote: > Thank you. > after set I call this method: >     $this->Cookie->read('mycookie'); > and it return this error: >     Warning (512): You cannot use an empty key for > Security::cipher() > if I call with debug function so: >     debug($this->Cookie->r

Re: Editor for Comments

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 3:33 PM, Krissy Masters wrote: > Would love to see the jwysiwyg element. I have HTMLpurifier set up already. Here you go: http://pastebin.com/NT59Vuag I pared it down to the essentials. Basically, adjust the editor options based on the desired set. This way, I can customi

Re: Difference between $this->Html->script

2011-03-10 Thread cricket
On Thu, Mar 10, 2011 at 5:40 PM, Krissy Masters wrote: > What’s the difference between $this->Html->script and > $this->Javascript->link? > > > > I used both with my current setup and both work fine so curious if both do > the same thing or maybe 1 has an advantage over the other? > > > > I can no

Re: Mobile Phone Layout - Using the RequestHandler in the CakeErrorController / AppError

2011-03-10 Thread DigitalDude
Hey, I did the exact same thing. I created an app_error.php and there I can ovverride the actions for the errors like missingView, missingAction, even error404. I invoked the RequestHandler there, so I can render the correct template. For the layout I did what thatsgreat2345 suggested. I checked

Find all records from "last week" or "this week"

2011-03-10 Thread DigitalDude
Hey, I just can't figure this out, but I need a find for fetching all records that were created "this week" or "last week". To clarify this, I'm running a cronjob every sunday and create some reports for each user. I need to find every record that was created within the ending week. When the cro

is htaccess problem or cakephp's problem?

2011-03-10 Thread cake-learner
My app used to forward to login.php page when user comes into the page but today it started going to index.php/login instead. mydomin.com/login page still exists but when i rediret( /login ) it goes to index.php/login -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakeph

Re: Find all records from "last week" or "this week"

2011-03-10 Thread thatsgreat2345
I'm assuming you have a column in the database called created which cake will fill in automatically If you check the book it gives you an example here http://book.cakephp.org/#!/view/1017/Retrieving-Your-Data under the complex find conditions $conditions = array( "Post.created >" => date('Y-m-d',

Re: Building spell check into forms

2011-03-10 Thread Ryan Schmidt
On Mar 10, 2011, at 10:44, chris wrote: > I have a requirement to provide a spell check functionality in some of > my forms. Meh. Does anybody actually want that? Why not just use a browser or operating system that already provides spell check on the client side? (e.g. Mac OS X has system-wide

Re: Building spell check into forms

2011-03-10 Thread Dr. Tarique Sani
Check out http://www.afterthedeadline.com/ HTH Tarique On Thu, Mar 10, 2011 at 10:14 PM, chris wrote: > I realise that this isn't stictly a cakePHP question. But as I'm > building my application in cakePHP, I just wanted to see if anyone had > any advice in the area. > > I have a requirement to

Re: CSS help

2011-03-10 Thread dunny
Thanks for that =) Its found in config/core.php Configure::write('Asset.timestamp', 'force'); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related question

Re: Take id from autocomplete's data

2011-03-10 Thread thom
On Fri, Mar 11, 2011 at 2:26 AM, cricket wrote: > > No need to apologise or be embarrassed. Lots of people never bother > trying to learn a different langauge. (Oddly enough, they're mostly > english-speakers ;-) The point of your question was clear enough. I > saw it but didn't respond because I

[Question] About basic cakePHP

2011-03-10 Thread thom
Hello (again),, I have some question about cakePHP : 1. What are the differences (comparation) between cakePHP 1.2 and cakePHP 1.3? I'm starting to use cakePHP 1.3 and I think I should know a little bit knowledge on previous version.. So if I search on Google and find some script based on cake ca

Re: [Question] About basic cakePHP

2011-03-10 Thread Jeremy Burns | Class Outfit
See here for differences: http://book.cakephp.org/#!/view/1554/Appendices The Form and Html helpers are available by default: http://book.cakephp.org/#!/view/961/components-helpers-and-uses $form/$html are old syntax. Now always use $this->Form & $this->Html. Jeremy Burns Class Outfit jeremybu

Re: Problems in saving form data to database

2011-03-10 Thread goluhaque
No error was recorded in the Apache log file. Couldn't check the database log file as I didn't know where it was or how it could be accessed. I am using XAMPP(internal server) and a search could not reveal any results, On Mar 10, 5:27 pm, Afzalul Haque wrote: > Haven't checked that one yet. Will

Re: [Question] About basic cakePHP

2011-03-10 Thread thom
On Fri, Mar 11, 2011 at 12:04 PM, Jeremy Burns | Class Outfit wrote: > See here for differences: http://book.cakephp.org/#!/view/1554/Appendices > The Form and Html helpers are available by > default: http://book.cakephp.org/#!/view/961/components-helpers-and-uses > $form/$html are old syntax. Now

Re: [Question] About basic cakePHP

2011-03-10 Thread Jeremy Burns | Class Outfit
It's not much of a leap. Generally the main problems you'll have are related to $form and $html, but the new syntax ($this->Form etc) have worked for ages, so most good code examples will use them anyway. Beyond that, you have to try the code and see what breaks. Refer to the appendix I sent yo

Re: [Question] About basic cakePHP

2011-03-10 Thread thom
On Fri, Mar 11, 2011 at 1:07 PM, Jeremy Burns | Class Outfit wrote: > It's not much of a leap. Generally the main problems you'll have are related > to $form and $html, but the new syntax ($this->Form etc) have worked for > ages, so most good code examples will use them anyway. > > Beyond that,