Create function and call it everywhere

2011-04-15 Thread thom
Hello, I want to create some functions and want to able to call it every where (Controller/ View). How could I do that? Where I have to place it? -- Regards,,, mastanto http://www.mastanto.com http://thom-sharing.blogspot.com -- Our newest site for the community: CakePHP Video Tutorials

Re: Create function and call it everywhere

2011-04-15 Thread Ryan Schmidt
On Apr 15, 2011, at 01:48, thom wrote: Hello, I want to create some functions and want to able to call it every where (Controller/ View). How could I do that? Where I have to place it? CakePHP is object-oriented, thus you would be encouraged to create a class and a method inside it, not a

Re: URL Case

2011-04-15 Thread Ryan Schmidt
On Apr 14, 2011, at 14:49, stas kim wrote: This might help http://www.pseudocoder.com/Super_Awesome_Advanced_CakePHP_Tips.pdf search 'Case Insensitive' I haven't read the rest of that document, but the Case Insensitive section is certainly inaccurate. Its first sentence Generally

Re: Create function and call it everywhere

2011-04-15 Thread thom
CakePHP is object-oriented, thus you would be encouraged to create a class and a method inside it, not a bare function. To create a class you can use from anywhere, put a file in APP/libs (for example my_class.php), make a class in it (like class MyClass), and then import it wherever you

Re: I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-15 Thread jackgoh
Thanks for all your helping!!! Thanks morficus, $this-Form-input('saveDate', array('type'='text')); OR $this-Form-text('saveDate'); is my solution. Thanks. Regards Jack On Apr 14, 10:47 pm, morficus morfi...@gmail.com wrote: in your view file... you should have something that looks like

Re: cake IDE

2011-04-15 Thread euromark
i agree with tilen: http://www.dereuromark.de/2010/09/22/setting-up-phpdesigner-for-cakephp/ On 15 Apr., 06:46, Zaky Katalan-Ezra procsh...@gmail.com wrote: I think netbeans is the best. What feature you are looking for? -- Our newest site for the community: CakePHP Video Tutorials

Cake não exibe minha view.

2011-04-15 Thread Uriel Juliatti
Fala pessoal, beleza? Estou iniciando com o Cake e estou passando por dificuldades. Instalei, tudo ocorre perfeitamente, mas na hora que construo meu primeiro teste com MVC ele dá erro. Eu estou fazendo isso: http://localhost/cake/posts/hello_world e retorna um erro: Not Found The requested

Checkbox FormHelper

2011-04-15 Thread Yuka Poppe
Hi Folks, I'm trying to use multiple-select checkboxes to display a few options in my forms, however, they do not conform to either $option['div'] = False nor $option['div'] = 'custom-class' nor $option['separator'] = ... The helper simply keeps wrapping the checkboxes in div's with class

Re: checkbox field to display

2011-04-15 Thread euromark
you should preset the state form the controller with $this-data[Model][field] = 0/1 not from the view! On 14 Apr., 14:35, timir maji majiti...@gmail.com wrote: Please try this echo $this-Form-checkbox('fieldname',array('checked'=true)); I use this in many project all work fine. Thanks

problem in save form

2011-04-15 Thread Juliano Bordignon
hello i have a strange problem when i save the form in one of my actions.. the file input try to save a array in ther the db collumm so, the debbugee display this error SQL Error: 1054: Unknown column 'Array' in 'field list' this does not happen in the add action because there I use the class

Re: URL Case

2011-04-15 Thread AD7six
On Apr 15, 9:25 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Apr 14, 2011, at 14:49, stas kim wrote: This might help http://www.pseudocoder.com/Super_Awesome_Advanced_CakePHP_Tips.pdf search 'Case Insensitive' I haven't read the rest of that document, but the Case Insensitive

Insert instead of update - tried everything

2011-04-15 Thread mattcrox
Hi, I've looked through numerous posts, and tried about 5 different ways of updating a single column in a record of mine. Here's my method (within the Auction model class): function setFinished($id) { echo 'Trying to setFinished with id of ' . $id;

Re: Insert instead of update - tried everything

2011-04-15 Thread euromark
$this-Auction-id ??? it's $this-id inside the model u are already using it correctly in $this-saveField! On 15 Apr., 15:29, mattcrox mattc...@gmail.com wrote: Hi, I've looked through numerous posts, and tried about 5 different ways of updating a single column in a record of mine. Here's

Re: Insert instead of update - tried everything

2011-04-15 Thread mattcrox
Thanks for replying, Unfortunately, when I don't explicitly set the Model's ID, it INSERTS and new records instead of performing an UPDATE. I seem to have got it working. It had something to do with the id of the object being 0. I changed it in the DB to 1, and it seems to work as expected. I

Re: Auth Problem Again..

2011-04-15 Thread AD7six
On Apr 14, 3:21 pm, Mariano Iglesias mariano.igles...@cricava.com wrote: That is correct, the $this-Session-flash('auth'); message is not part of the layout because I relayed on people following: http://book.cakephp.org/view/1252/Displaying-Auth-Error-Messages In order to show all normal

Changing Primary Key in Model is not being recognized

2011-04-15 Thread Deftly-D
I am trying to override the PrimaryKey used to join tables, but the query that CakePHP is generating keeps using 'id' as the primary key. This is in CakePHP version 1.3.7 Please suggest any changes that don't involve changing the database structure. The models that I am trying to join are as

Re: Auth Problem Again..

2011-04-15 Thread Mariano Iglesias
Anyway if you get the flash messages, it should be consumed by the login action. Meaning that if you enter wrong credentials, and thus the login message shows again, then the $this-Session-flash('auth') line should consume the message. I would guess (that recipe isn't in my RAW pdf,

Re: Insert instead of update - tried everything

2011-04-15 Thread Zaky Katalan-Ezra
Set the id field to auto increment -- 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 from this group, send email to

Re: nocache breaks when used in loop

2011-04-15 Thread Brian Sweeney
On Thu, Apr 14, 2011 at 2:49 PM, cricket zijn.digi...@gmail.com wrote: On Thu, Apr 14, 2011 at 11:00 AM, Brian Sweeney eclecticg...@gmail.com wrote: I think even though some of the content is state-sensitive the page could still benefit from view caching. It does present some difficulties,

what is $this-Html-meta('icon') and AppHelper not working

2011-04-15 Thread varai
Hi, Can someone tell me what is the use of? $this-Html-meta('icon'); Referring to the cakephp cookbook, page 274, in order to get rid of the many ? ? and many echo() calls, i added the following code to app_helper.php under class AppHelper extends Helper: function output($str){

Re: what is $this-Html-meta('icon') and AppHelper not working

2011-04-15 Thread euromark
i think this is not the right way to go not without reason 1.3 does not echo anymore by default in many places and soon, __() will not, either this is a step backwards there is nothing wrong using echo $this-Html-... it gives you more control over the code and enables you to chain the results.

Re: Auth Problem Again..

2011-04-15 Thread AD7six
On Apr 15, 4:55 pm, Mariano Iglesias mariano.igles...@cricava.com wrote: Anyway if you get the flash messages, it should be consumed by the login action. Meaning that if you enter wrong credentials, and thus the login message shows again, then the $this-Session-flash('auth') line should

Re: Cake não exibe minha view.

2011-04-15 Thread cricket
Do you have debug on? app/config/core.php: Configure::write('debug', 2); 2011/4/15 Uriel Juliatti uriel.juliattiva...@gmail.com: Fala pessoal, beleza? Estou iniciando com o Cake e estou passando por dificuldades. Instalei, tudo ocorre perfeitamente, mas na hora que construo meu primeiro

Re: Cake não exibe minha view.

2011-04-15 Thread LipeDjow
Fala Uriel, blz? Provavelmente esse problema não é de código, e sim de configuração do Apache. Dá uma lida nesse link que deve resolver seu problema: http://book.cakephp.org/view/917/Apache-and-mod_rewrite-and-htaccess Outra dica seria postar suas dúvidas nessa lista em inglês, pois você terá

Is there any place on the web where we can submit and check migrations plugin issues?

2011-04-15 Thread huoxito
I was just looking for something like that and couldn't find it. Guess theres a bug when you generate migrations to change a varchar field to datetime. It write a query with datetime(100) for example .. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org

Re: Is there any place on the web where we can submit and check migrations plugin issues?

2011-04-15 Thread huoxito
problem solved. I had to add a length = null to the field array -- 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 from this

Re: nocache breaks when used in loop

2011-04-15 Thread cricket
On Fri, Apr 15, 2011 at 11:38 AM, Brian Sweeney eclecticg...@gmail.com wrote: On Thu, Apr 14, 2011 at 2:49 PM, cricket zijn.digi...@gmail.com wrote: function startup(Controller) {    $this-Controller = $Controller; } I don't have anything like the startup function (I assume that's part of

Can't CakeLog use in CLI ?

2011-04-15 Thread Điển vũ
I can't use CakeLog::write(); write log when run CakePHP's Shell Task . Can't CakeLog use in CLI ? -- 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

Re: nocache breaks when used in loop

2011-04-15 Thread Brian Sweeney
On Fri, Apr 15, 2011 at 2:47 PM, cricket zijn.digi...@gmail.com wrote: But yes, this is how I'm passing variables to the view. Except in some of the non-cached code where I'm using requestAction() to get data I need. But requestAction() is a horrible performance hog so hopefully you'll

Re: nocache breaks when used in loop

2011-04-15 Thread Brian Sweeney
On Fri, Apr 15, 2011 at 2:47 PM, cricket zijn.digi...@gmail.com wrote: What the heck is this?! echo ?php $product_id = $product_id; ?; ? Oh, and I just wanted to say that I was pretty sure this little snippet would get that kind of reaction. Nice to know that you care enough to point out the

Re: problem in save form

2011-04-15 Thread timir maji
Hi, Suppose this is image field ?php echo $this-Form-input('MyModel.image',array('type'='file')); ? In edit action just check,if you upload any photo or not if(empty($this-data['MyModel']['image']['name'])) { unset($this-data['MyModel']['image']);

Cake PHP as Multisite / Multidomain

2011-04-15 Thread Carlos Eduardo Sotelo Pinto
Hi people. I have read this article and thinking on a new challenge ( if it coudl be called a challenge ). What about having a cakephp installed on a server.. like a dedicated server, optimized for multiple domains, for example multiple domains acounts for multiple cpanel accounts. Starting on

Re: cake IDE

2011-04-15 Thread Vinícius Rodrigues
I'm very thanks guys, for he tip of new IDE and for tips to implements de framework in netbeans (my actual IDE) im answered for me with objective to answer for all, if have another way to do this, i wanna know. PS Sorry for my english, i'm brazilian On 14 abr, 18:36, Vinícius Rodrigues

Re: Can't CakeLog use in CLI ?

2011-04-15 Thread Ryan Schmidt
On Apr 15, 2011, at 14:30, Điển vũ wrote: I can't use CakeLog::write(); write log when run CakePHP's Shell Task . Can't CakeLog use in CLI ? Why not? What happens? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions