Re: Help with testing different things

2012-03-11 Thread majna
To test flash message, check session: $this->assertEqual($this->TestController->Session->read('Message.flash.message'), __('Saved.')); On Sunday, March 11, 2012 10:13:10 PM UTC+1, andrewperk wrote: > > In case someone finds this post later, I found an easier way to test html > tags rather

Re: Help with testing different things

2012-03-11 Thread andrewperk
I figured out how to test for an exact flash message. For instance a mocked up Posts controllers add action, testing a flash message of 'Post successfully saved': $Posts->Session->expects($this->once())->method('setFlash')->with($this->equalTo('Post successfully saved')); $Posts of course is

Re: Help with testing different things

2012-03-11 Thread andrewperk
In case someone finds this post later, I found an easier way to test html tags rather than using assertTags from the view by using assertRegExp or assertPattern: $result = $this->testAction('url', array('return'=>'view')); $this->assertRegExp('/view and $this->contents are always null as well wh

Re: @Miles J - Uploader

2012-03-11 Thread Miles J
Awesome :] Glad you got it working. On Saturday, March 10, 2012 11:31:37 PM UTC-8, CrotchFrog wrote: > > @Miles: > > I have it working as expected now. > The problem was that I was inadvertently supplying delete() with an array. > I was using named keys in the array and Cake's Core Model.php r

paginations issue

2012-03-11 Thread Miloš Vučinić
Hey guys I have a question regarding pagination and filters of the pagination in cake 1.3 . In my index function I have created a filter on top. It's a simple form, and if not empty $this->data on index function I apply conditions for pagination. Example : if (!empty($this->data)) {

Re: Error on input field

2012-03-11 Thread Paulo H3nrique Alves
The correct is.. echo $this->Form->input('name', array('disabled' => 'disabled')); CakePHP 2.1 Em sexta-feira, 13 de fevereiro de 2009 14h13min24s UTC-2, Marcelo F Andrade escreveu: > > On Fri, Feb 13, 2009 at 12:34 PM, marco...@gmail.com > wrote: > > > > How can I enabled readonly for this fie

Re: $this->redirect not working

2012-03-11 Thread Brian Bowler
@Geore, I have tried taking it out and what happens is that it goes to the '/formulas/instructions/' page minus the ID variables. I assume this happens because this is happening because of POST. I either want to redirect to a different page such as 'formulas/manage' (for example) or redirect to '/f

Re: $this->redirect not working

2012-03-11 Thread vijay kumbhar
Yes try the $this->redirect($this->referer()); http://book.cakephp.org/1.2/view/430/referer Thanks, Vijay On Mar 11, 10:01 am, romel javier gomez herrera wrote: > try with this  $this->redirect($this->referer()); > > El 10 de marzo de 2012 21:24, Brian Bowler escribió: > > > > > > > > > So I

Re: Models can be loaded from a component?

2012-03-11 Thread Tilen Majerle
ou maan don't use App::import('Model', $key); $this->$key = new $key; use $this->{$key} = ClassRegistry::init($key); //ClassRegistry will automatically load model and do all stuff that need to be done and also...set() method is controller method, not component method and for render is the same

Re: Models can be loaded from a component?

2012-03-11 Thread Tilen Majerle
you can load model to controller, so something like $this->Controller->loadModel('ModelName') and then you can use it with $this->Controller->ModelName->methodName(); or you ClassRegistry::init('ModelName'); to initialize a model :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/3/10 rome