Re: CakeError using themes

2012-03-07 Thread pablosky
Any ideas? On 7 mar, 17:23, pablosky wrote: > Yes, viewClass is declared before beforeFilter. > > public $ viewClass = 'Theme'; > > The entire application uses themas correctly. > > Thank! > > On 7 mar, 15:38, Tilen Majerle wrote: > > > &

Re: CakeError using themes

2012-03-07 Thread pablosky
Yes, viewClass is declared before beforeFilter. public $ viewClass = 'Theme'; The entire application uses themas correctly. Thank! On 7 mar, 15:38, Tilen Majerle wrote: > maybe try to set viewClass = 'Theme'; > -- > Lep pozdrav, Tilen Majerlehttp://maj

CakeError using themes

2012-03-07 Thread pablosky
Hello, Version 2.0.5 To change the layout of the errors is easy: // In beforeFilter if ($this->name === 'CakeError') { $this->layout = 'default'; } But how I can do to use a layout of a theme? I tried this but it works: // In beforeFilter if ($this->name === 'CakeError') { $this->theme

Re: simple auth in 2.0

2012-02-23 Thread pablosky
zation Application Tutorial > > On 22 Feb., 21:23, pablosky wrote: > > > > > > > > > Hello, > > > I used CakePHP 1.3 and now I come to CakePHP 2.0. > > > Do not know how to do a simple authentication system. > > > I have this in AppController: >

simple auth in 2.0

2012-02-22 Thread pablosky
Hello, I used CakePHP 1.3 and now I come to CakePHP 2.0. Do not know how to do a simple authentication system. I have this in AppController: public $components = array('Cookie', 'RequestHandler', 'Session', 'Auth'); public function beforeFilter() { $this->Auth->loginRedirect = array('cont

Re: Filter results by tags. (HABTM)

2012-02-18 Thread pablosky
t; 1, 'Type.name' => 'Posts', 'Lang.alias' => Configure::read('Config.language'), $condition), 'contain' => array( 'Type' => array('fields' => array('Type.name')), &#x

Filter results by tags. (HABTM)

2012-02-18 Thread pablosky
Hello, I use CakePhp 2.0.5. In my project I have the following relations: Content (belongTo) > Type Content (belongTo) > Lang Content (HABTM) > Tag Type (hasMany) > Content Lang (hasMany) > Content Tag (HABTM) > Content For a listing of records for a blog I have the following code: $posts = $t

Re: Problem with association (3 levels)

2012-01-17 Thread pablosky
In my case, the two relationships are belongTo. But in the example of CakePHP documentation the first relationship is belongTo and the second is hasMany. http://book.cakephp.org/2.0/en/models/model-attributes.html#recursive But I will try containable. Thank you very much! On 16 ene, 22:27, je

Re: Problem with association (3 levels)

2012-01-17 Thread pablosky
On 16 ene, 22:27, jeremyharris wrote: > You said they are both belongsTo, but then you said the second relationship > is hasMany. > > hasMany are pulled as a separate query, so calling it like this won't work. > You can, however, use containable: > > $this->Comment->find('all', array( >   'field

Problem with association (3 levels)

2012-01-16 Thread pablosky
Hello, I have 3 models: Comment (belongTo)> Content (belongTo)> Type I need to access from model to model Type Comment: $this->Comment->find('all', array('recursive' => 2, 'fields' => array('Comment.id', 'Comment.active', 'Content.id', 'Content.slug', 'Type.slug', 'Comment.author', 'Comment.tit

Problems with validation

2011-04-12 Thread pablosky
Hello, I have problems with file validation. I have several forms for uploading files. The validation simply does not work. And all files are loaded. For example, the simplest: var $validate = array( 'archive' => array( 'extension' => array( 'rule'

Re: Problem with "loadModel" and "afterSave"

2011-02-17 Thread pablosky
Fixed. The problem was that the model is within a plugin. $this->loadModel('Settings.Setting'); Thanks!!! On 17 feb, 14:06, "Dr. Loboto" wrote: > Does it really loads this model? Simplest check is by class name: > pr(get_class($this->Setting)); >

Problem with "loadModel" and "afterSave"

2011-02-17 Thread pablosky
Hello. I have a controller that using another model . And save some data: $this->loadModel('Setting'); $this->Setting->saveAll($settings['Settings']['Setting']); The model is this: class Setting extends SettingsAppModel { var $name = 'Setting'; function afterSave() {

Associations in app_controller.php

2010-11-29 Thread pablosky
Hello. I'm trying to extract data from a table from the app_controller.php. But the table is related to another table using "belongTo." This code works: if (!Cache::read('links')) { $this->loadModel('Link'); $result = $this->Link->find('all', array('fields' => array('Link.id', 'Link.name', '

Re: Validation error messages in view.

2009-12-17 Thread pablosky
or 'allowEmpty' with an error message. Thank you very much for your help. On 17 dic, 11:38, John Andersen wrote: > Try to rename your error labels, so they do not conflict with existing > error labels! > > Change "between" to "username_between" a

Re: Validation error messages in view.

2009-12-17 Thread pablosky
gt; http://book.cakephp.org/view/133/Multiple-Rules-per-Field > > Example: > > print( >    $form->input( >       'username', >        array( >          'label' => __('user name',true), >          'error' => array( >             'users_username_

Re: Validation error messages in view.

2009-12-17 Thread pablosky
Thanks for answering. I do this because I need to translate the messages of validation. I found this method in the book and also cake "bakers": http://book.cakephp.org/view/133/Multiple-Rules-per-Field (In the end) http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-

Validation error messages in view.

2009-12-16 Thread pablosky
Hello. I need to translate the error messages. I have this in my model: var $validate = array( 'username' => array( 'between' => array( 'rule' => array('between', 4, 10), 'last' => true ), 'unique' => array( 'rule'

Auth + Acl + Redirect

2009-12-07 Thread pablosky
Sorry for my English. I'm doing an access control system using Auth and Acl components. In AppController: $this->Auth->loginAction = array ('controller' => 'users', 'action' => 'login'); $this->Auth->logoutRedirect = array ('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect