Reverse routing syntax

2010-01-19 Thread jordicakephp
Good morning, I'm trying to implement the reverse routing capability to my app through the following two instructions. In my view: echo $html->link( $province[0], array('controller' => 'users', 'action' => 'directory', 'es-es', '0', 'province' => $

What's going on with www.cakephp.org?

2009-10-28 Thread jordicakephp
Hello everybody, it's 10:45 am in Barcelona, Spain. When trying to access the project's site, www.cakephp.org, I'm getting some very strange images! The site seems to be attacked or I don't understand the message that the project is trying to send us (it's Halloween and I'm a catalan guy ;-) Chee

Re: Inflector and compound names

2009-08-21 Thread jordicakephp
egular plurals alone but cannot process them correctly when string > which have other part. > > As workaround you can try split compound controller name, singularize > last part and unite them again... > > On Aug 20, 4:48 pm, jordicakephp wrote: > > > > > Dr.Loboto

Re: Inflector and compound names

2009-08-21 Thread jordicakephp
By the way, should I do something special to communicate this Inflector's behaviour? On 21 ago, 10:55, jordicakephp wrote: > Thanks a lot, Dr. Loboto. :-) I've finally done your trick and it > works! > > On 21 ago, 06:03, "Dr. Loboto" wrote: > > > >

Re: Inflector and compound names

2009-08-21 Thread jordicakephp
part. > > As workaround you can try split compound controller name, singularize > last part and unite them again... > > On Aug 20, 4:48 pm, jordicakephp wrote: > > > > > Dr.Loboto, thanks a lot. :-D > > > I've tried $irregularPlural = array (

Re: Inflector and compound names

2009-08-20 Thread jordicakephp
Sorry, I ment ($this->name is the controller associated to the vies, in my case SedeUves). > [params][models][0] or Inflector::Singularize($this->name) ($this->name is > the controller associated to the view, in my case > > DiccionarioUves). --~--~-~--~~~---~--~~

Re: Inflector and compound names

2009-08-20 Thread jordicakephp
y view with $irregularPlural = array ('uve' => 'uves'); and it only works if the table's name is uves. That is, if I undersand, this solution doesn't work for table compound names, such as sede_uves. What am I doing wrong? Thanks a googol! :-D On 20 ago, 10:40, &qu

Re: Inflector and compound names

2009-08-19 Thread jordicakephp
the model) from sede_uves (the name of the table). Sorry again and thanks a lot. On 19 ago, 19:06, jordicakephp wrote: > Good afternoon everybody, > > I'm trying to define a new rule of type singular-plural so that > CakePHP joins magically the table and the model names that these rul

Inflector and compound names

2009-08-19 Thread jordicakephp
Good afternoon everybody, I'm trying to define a new rule of type singular-plural so that CakePHP joins magically the table and the model names that these rule refers to. More specifically, I go to inflections.php and write: $irregularPlural = array('sedeuve', 'sedeuves'); But this doesn't work

Re: Custom error messages of the model

2009-08-18 Thread jordicakephp
Thanks a lot! :-D $this->invalidate worked perfectly. On 17 ago, 07:54, "Dr. Loboto" wrote: > You can try to do $this->invalidate('myField', 'myMessage') in your > myCustomRule() method and do not use 'message' key in $validate for >

Custom error messages of the model

2009-08-15 Thread jordicakephp
Good afternoon everybody, I would like the custom validation functions of my models to return different error messages, depending on what the user has sent. That is, to define these messages not in compilation time, but during the execution of the model's logic. I've tried to to that in the befo

Re: How to modify the URLs of $paginator->numbers

2009-07-30 Thread jordicakephp
by testing it in > the view > > echo $html->link('test link', array('controller' =>'france', 'action' > => 'list')); > > should outputwww.myCakePHPApp.com/countries/europe/france/list > if your route is set up right i

How to modify the URLs of $paginator->numbers

2009-07-29 Thread jordicakephp
Good morning everybody, I've organized my controllers in a manner similar to the following: /countries /africa /america /europe /france /italy /spain And I've created them in their respective folders. Consequently, I've als

Re: Access the model name from a view

2009-07-20 Thread jordicakephp
27;paging']); > > That should do the trick. > > hth > grigri > > On Jul 20, 11:47 am, jordicakephp wrote: > > > Hi again, my dear baker friends. > > > Until now, when I've written this in a controller: > > > $paginatedQuery = $this->paginate

Access the model name from a view

2009-07-20 Thread jordicakephp
Hi again, my dear baker friends. Until now, when I've written this in a controller: $paginatedQuery = $this->paginate($this->modelClass); I've coded this in a view to access the information that it returns (inside a foreach loop, of course): $row['ModelName']['user_login'] That is, hard-c

Re: A hierarchy of controllers

2009-07-20 Thread jordicakephp
; > class ForumCarController extends ForumController { > > } > > /app/controllers/forum_car_controller.php > > On Jul 20, 11:26 am, jordicakephp wrote: > > > > > Hi friends, from Barcelona. > > > I've abstracted the functionality of a generic fo

A hierarchy of controllers

2009-07-20 Thread jordicakephp
Hi friends, from Barcelona. I've abstracted the functionality of a generic forum in the class ForumContoller because I'm trying to build a hierarchy of controllers. I do this in the next manner: I program ForumController, the most generic controller, in /app/ controllers. Then, I extend this con

Paginate a TreeBehavior table with extra fields

2009-07-10 Thread jordicakephp
Hello friends, I've implemented a forum with the Tree Behavior which fields are the following: id parent_id lft rght title user_id date message All my CRUD functions are working well. I've written this method to paginate this table: function list(){ $this->set('queryForumCars',$this->paginate

Re: Connecting to web services

2009-06-26 Thread jordicakephp
Hello, I think that it may depend on what you want to do. Anyway, one of the smartest ways to connect a web service to your app is through a datasource. http://debuggable.com/posts/datasources,-models,-components,-behaviors:48bd3025-2c44-40b6-a6e7-35674834cda3 Regards. On 26 jun, 06:09, Turgs