Re: Single query at bootstrap: how to

2011-07-06 Thread ark0n3
ds = null) >     { >         parent::__construct($id, $table, $ds); >         if (!defined('GLOBAL_ZONE_SET') && $this->useTable !== false) >         { >             $this->execute("SET GLOBAL time_zone = ‘+2:00′'"); >             define('GLOBAL

Re: Single query at bootstrap: how to

2011-07-05 Thread ark0n3
#x27;GLOBAL_ZONE_SET', true); >         } >     } > > On Jul 4, 4:31 pm, ark0n3 wrote: > > > > > > > > > Hi everyone > > I'm going crazy for such a trivial matter. I need to run a one-time > > query at the beginning of the connection

Single query at bootstrap: how to

2011-07-04 Thread ark0n3
Hi everyone I'm going crazy for such a trivial matter. I need to run a one-time query at the beginning of the connection to the mysql server (SET GLOBAL time_zone = ‘+2:00′) but can't figure out where I need to put the code in the cake codebase. Many thanks in advance to whoever will help me fix t

Re: parseExtension question allows just a subset of extensions??

2009-11-11 Thread ark0n3
Figured out by myself.. You just have to add $this->RequestHandler->setContent('rtf', 'application/rtf'); in app_controller.php beforeFilter() On 11 Nov, 11:45, ark0n3 wrote: > Hi > I'm banging my head against the wall trying to figure out why CakePHP >

parseExtension question allows just a subset of extensions??

2009-11-11 Thread ark0n3
Hi I'm banging my head against the wall trying to figure out why CakePHP does not parse the .rtf extension, after that I added the extension in Router::parseExtensions('json', 'xml', 'rtf', 'pdf'), /app/views/ layouts/rtf/default.ctp and /app/views/controllername/rtf/ action_name.ctp Please let m

Re: Order by Contain field

2009-10-24 Thread ark0n3
Did you try with 'order' => array('Person.surname' => 'ASC') ? > ((I'm away from any code, so I can't check atm)) > > On Oct 23, 6:38 pm, ark0n3 wrote: > > > Yes, a related model but in the form > > > Teacher -> belongs

Re: Order by Contain field

2009-10-23 Thread ark0n3
> A totally unrelated model, or ? > >     var $paginate = array( >     'fields' => array(all_fields_here), >     'limit' => 15, >     'order' => array( >     'SomeModel.someField' => 'desc') >     ); > > Work

Re: Order by Contain field

2009-10-22 Thread ark0n3
Hi Melanie thanks for your kind reply. I meant general sorting, not necessarily in the view, something like SELECT * FROM User inner join Group order by Group.name I think it's quite amazing such a basic feature could not be achieved with CakePHP, a workaround has to exist (different from manuall

Order by Contain field

2009-10-22 Thread ark0n3
Hi does anyone know if it's possible to order by a contained fields? It seems to me like a simple task but I'm unable to manage it.. I have a User model associated with a Group field and I'd like to order User by Group.name. Thanks Nicola --~--~-~--~~~---~--~~ You

HABTM single row

2009-10-20 Thread ark0n3
Hi many thanks to all members, you represent an invaluable support for worldwide CakePHP developers! This is my problem: i'm trying to create a new HABTM row, in a "Course" view I coded echo $form->create('Course', array('url' => array('action' => 'view', $course['Course

Re: Pagination + cache: they can't be together?

2009-09-08 Thread ark0n3
Thank you Jon, this is the second time I get replied from you and you've always been extremely kind! I understood your code but it does not seems to me like the righteous MVC way, so I think I'll be using a different approach. I had to code a pagination method to work with HABTM relationships and

Pagination + cache: they can't be together?

2009-09-08 Thread ark0n3
Hi I'm using native CakePHP cache methods and got excellent results in a very little time. I had just an annoying problem: I'm unable to cache pagination results because I get "Undefined variable: paginator" in the views. function index() { $cachename='home_'.$this->getCur

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
That's a good starting point but there's need to change every interested line in the views, while I'd like to obtain an automatic and centralized solution i.e. if I write a new page there should be no need to remember that "work-around" On 26 Ago, 15:42, Jon Bennett wrote: > Hi Nicola, > > > tha

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
t or use a radio > button that displays a readable string to the user but holds the raw > data as the value. > > On Wed, Aug 26, 2009 at 2:46 PM, ark0n3 wrote: > > > Hi Jon > > thanks for your kind reply but that's just what I'd avoid: I'm trying > > to acc

Re: MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
Hi Jon thanks for your kind reply but that's just what I'd avoid: I'm trying to accomplish an automatic way to achieve that result, I know it's not right to use a model function and I asked for an MVC and non- validation-breaking way.. On 26 Ago, 11:23, Jon Bennett wrote: > Hi Nicola. > > > I'

MVC-way to obtain common data formatting

2009-08-26 Thread ark0n3
his is the best way to accomplish this 'cause I noticed that (of course) it causes problems when trying to edit something: the datas are formatted as I requested in the app_model but this causes validation problems (super simple example: boolean humanized as "Yes/ No" and n

GROUP BY bug?

2008-12-21 Thread ark0n3
php or not? I've fixed the thing with this code inside afterFind($results) { foreach($results as $k => $r) { if (isset($r[0])) { foreach($r[0] as $k2 => $v2) $results[$k] ['Transaction'][$k2]=$v2; unset($results[$k][0]); } } Thanks ark0n3 --~--~

Re: A newbie question (I'm unable to find it answered)

2008-12-20 Thread ark0n3
the view... > > echo $booleanField ? 'Yes' : 'No'; > > On Dec 18, 6:27 pm, ark0n3 wrote: > > > Is there absolutely no way to accomplish that? It seems to me like an > > obvious way to centralize some model-view i.e. if a Model is flagged > > "

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread ark0n3
> model or app model. > > On Dec 18, 5:05 pm, ark0n3 wrote: > > > I'm experimenting with the method you suggested and it's great.. today > > I had only great problem: how to use an helper in the model? If I > > define the $helpers array I'm unable to

Re: A newbie question (I'm unable to find it answered)

2008-12-18 Thread ark0n3
23:20, mark_story wrote: > Perhaps try editing the model data in afterFind().  Or changing it > before its saved in beforeSave().  Both of these methods would be in > your models. > > -Mark > > On Dec 12, 2:52 pm, ark0n3 wrote: > > > Hi > > I'm sorry to both

Re: A newbie question (I'm unable to find it answered)

2008-12-14 Thread ark0n3
You're the best, that's just the exact thing I need! Really, really thanks! ark0n3 On 12 Dic, 23:20, mark_story wrote: > Perhaps try editing the model data in afterFind().  Or changing it > before its saved in beforeSave().  Both of these methods would be in > your models. &

A newbie question (I'm unable to find it answered)

2008-12-12 Thread ark0n3
27;disc'. (I want to add a prefix to the disc). Is that possible? I've tried editing $this->data with beforeFilter and beforeRender but with no luck.. Hope someone will help me! Thanks ark0n3 --~--~-~--~~~---~--~~ You received this message because