child model that is deleted via dependent=true in 1 parent model does not update counterCache of 2nd parent

2011-07-10 Thread Zeu5
i have a model called Link it belongs to Webpage and LinkList LinkList has a counterCache of Link. It works whenever i delete or add a new Link. I have also set Webpage hasMany Link where dependent = true and exclusive = false. so whenever i delete a Webpage, all the associated Links are delete

Re: 1st party lib object class triggered Class __PHP_Incomplete_Class has no unserializer - how to resolve?

2011-07-09 Thread Zeu5
Anyone can help? I think this has more to do with unserialize issues handled by cakephp than have to do with Twig. On Jul 7, 4:02 pm, Zeu5 wrote: > using cake 1.3.9 > > I wrote a library class that i placed inside app/libs > > this class IteratorForTwig basically extends the Ar

redirect for css rendering

2011-07-09 Thread Zeu5
Hi i am using Twig for views in my cakephp application. Reason is I want to do something that allows designers to contribute different themes. Twig is already well integrated using a plugin so in my controller actions, i just use $this->render('template_name'); and $this->set to setup the variab

1st party lib object class triggered Class __PHP_Incomplete_Class has no unserializer - how to resolve?

2011-07-07 Thread Zeu5
using cake 1.3.9 I wrote a library class that i placed inside app/libs this class IteratorForTwig basically extends the ArrayObject class http://bin.cakephp.org/view/2007912078 I need it because I am using Twig to make building themes as designer- friendly as possible. I did $this->set('some_

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-06 Thread Zeu5
#x27; as filename and use > 'App::import("Lib", "ArrayToIteratorAggregate")' > > Am Dienstag, den 05.07.2011, 14:56 -0700 schrieb Zeu5: > > > > > > > > > Hi Thomas, > > > this is my code for the beforeRender. I got a Class no

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-05 Thread Zeu5
y($this->viewVars['iterators']) ? array() : > $this->viewVars['iterators']; >         foreach($iterators as $alias => $data) { >                 $iterators[$alias] = ArrayConverter::createAggregator($data); >         } >         $this->viewVars['itera

advice on refactoring beforeFilter in app_controller

2011-07-05 Thread Zeu5
Hi there, the beforeFilter function in my app_controller over time has grown into a monstrous 300 line code. in that beforeFilter, i do things like $this->set for non admin pages $this->Cookie->write $this->Auth->fields = array('username' => 'email', 'password' => 'password'); $this->Auth->autho

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-05 Thread Zeu5
eforeRender you could iterate over the viewVars and > convert the arrays accordingly. > > Regards, > Thomas > > Am Dienstag, den 05.07.2011, 02:41 -0700 schrieb Zeu5: > > > > > > > > > Hi there, > > > i think you mean a Model Behavior? > >

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-05 Thread Zeu5
roller behavior which > translates everything right away > > php doesnt have the attributes itself > but you can acomplish that by using: > $size = count($cars); > $first = array_shift($cars); > $last = array_pop($cars); > and may others > etc > > On 5 Jul., 02:38, Ze

Re: separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-04 Thread Zeu5
usual php arrays can possibly have these attributes as well. On Jul 5, 7:17 am, euromark wrote: > why are the normal 1.3 arrays not working for you? > they also have all those functions built in (in plain php functions > then of course) > > On 5 Jul., 01:06, Zeu5 wrote: > >

separate class that prepares an IteratorAggregate object for View layer - where to place this?

2011-07-04 Thread Zeu5
I have cars controller, Car model and views for cars. I am using Twig 1.0, http://www.twig-project.org/doc/templates.html#list-of-control-structures Cake 1.3 I want to do the following in the controller: function index() { ... $carData = $this->Car->find('all'); $cars = Car::prepareForView($

Re: how to use counterquery in cakephp

2011-03-25 Thread Zeu5
d counter field has no plural like wheel_count instead of wheels_count. On Mar 25, 8:14 pm, Jeremy Burns | Class Outfit wrote: > By the way - have a go and come back if you can't get it to work. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.c

Re: how to use counterquery in cakephp

2011-03-25 Thread Zeu5
Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 25 Mar 2011, at 11:39, Zeu5 wrote: > > > > > > > > > Hi > > > i need help understanding counterquery > > > i know right now cakephp allows me to

how to use counterquery in cakephp

2011-03-25 Thread Zeu5
Hi i need help understanding counterquery i know right now cakephp allows me to store children count in parent table eg a Car hasMany Wheel so in cars table, there is a wheels_count column. but i only want to store the wheel associated with a particular car AND has a status as 'active'. Meani

how do i customize a error404 for themes?

2011-03-22 Thread Zeu5
Hi, i am currently using http://github.com/m3nt0r/cakephp-twig-view plugin for theming issues. Long story short, instead of using CakePHP CTP views, this plugin allows me to use Twig a templating language like Smarty. It works great. All I need is to do a $this->render('filename'); it will r

is there a way to render views that are NOT in a controller folder under themed?

2011-03-20 Thread Zeu5
Hi there, I want to make it as easy as I can for my users to customize their own themes. I want to know if there is a way I can render views onto actions in this manner. under app/views/themed/some_theme_name/products/view.ctp, i am rendering this view for products view action. is there a way i

Re: array formatting for pagination

2011-03-20 Thread Zeu5
Paginated array Array ( [0] => Array ( [Product] => Array ( [id] => 8 [shop_id] => 2 [title] => test [code] => [description] => test [pric

Re: array formatting for pagination

2011-03-20 Thread Zeu5
27;image'] = $image; unset($images[$product_id]); break; } } } /* $realProducts is the result I want */ On Mar 21,

array formatting for pagination

2011-03-20 Thread Zeu5
Hi all, my pagination code in controller looks like this $this->paginate = array( 'conditions' => array('OR' => array ( array('ProductImage.cover'=>true), array('ProductImage.cover'=>null

Re: how to use transactions in cakephp

2011-01-12 Thread Zeu5
Thank you for the update PhpNut :) On Jan 12, 6:58 pm, "Larry E. Masters" wrote: > I just noticed this thread. You might want to look at a video someone > uploaded tohttp://tv.cakephp.orgrecently showing how to use transactions > with CakePHP > > http://tv.cakephp.org/video/guille1983/2011/01/10/

Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
. Are you passing any option to saveAll() other than data? > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Tue, Jan 11, 2011 at 5:11 PM, Zeu5 wrote: > > Thank you Amit, but the same issue arises. >

Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
> I think you need to try beforeSave() instead of beforeValidate(), hope it > may work. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Tue, Jan 11, 2011 at 5:02 PM, Zeu5 wrote: > > let say my model Link has

manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
let say my model Link has 3 fields route, model, action, what I want is that route is the combination of model and action. eg model = '/orders/view/'; action = '3'; so route is '/orders/view/3'; i did this in my beforeValidate if (isset($this->data['Link']['model']) && isset($this->data['Link'

Re: ajax added child row is not sent as part of data.

2011-01-07 Thread Zeu5
t 7:32 AM, Zeu5 wrote: > > Link is the model in this scenario. > > > In admin_index, > > > there is a list of Link records. > > > This whole list is wrapped within a Form. (Let us call this the > > EditListForm) > > > This EditListForm will post to t

ajax added child row is not sent as part of data.

2011-01-07 Thread Zeu5
Link is the model in this scenario. In admin_index, there is a list of Link records. This whole list is wrapped within a Form. (Let us call this the EditListForm) This EditListForm will post to the admin_edit action of the controller. I also have a Add Link Form directly below the list. The A

Re: paginate posts substring body which uses tinymce - do i substr in the paginate or at the view?

2011-01-03 Thread Zeu5
i am so ignorant. http://book.cakephp.org/view/1625/truncate this is the solution and a great one. On Jan 3, 8:25 pm, Zeu5 wrote: > Hi there, > > i have a cake webapp that includes a blog. > > the body of the blog posts uses tinymce so i can put in some HTML > coding for  th

paginate posts substring body which uses tinymce - do i substr in the paginate or at the view?

2011-01-03 Thread Zeu5
Hi there, i have a cake webapp that includes a blog. the body of the blog posts uses tinymce so i can put in some HTML coding for the body of the post. At the index page of the blog, i do a posts/index which uses paginate(). Straight forward enough. here comes the problem. at the index, i am

Re: how to use updateAll and IN clause together

2010-12-26 Thread Zeu5
Sorry I just realised where i went wrong. I should have included literal quotes. $this->updateAll(array('product_price' =>"'" . $newPrice . "'"),         array('product_id'=>$product_id,                'id '=>$cartItemI

how to use updateAll and IN clause together

2010-12-26 Thread Zeu5
This is the example of the query I want to execute. // UPDATE cart_items SET product_price = 2 WHERE product_id = 4 AND id IN (2,4) $this->updateAll(array('product_price' => $newPrice), array('product_id'=>$product_id, 'id '=>$cartItemIdArray)); $this->updateAll(array('pr

Re: how to use ssl to secure subdomains of a cakephp app

2010-12-25 Thread Zeu5
Hi Ryan, happy holidays! I have 3 questions. 2 are follow ups on your excellent replies. > The problem with this is figuring out how to transfer session data that > you've already started at subdomainx.example.com to secure.example.com. You > could set the session domain to example.com; that

Re: how to use ssl to secure subdomains of a cakephp app

2010-12-24 Thread Zeu5
r (enabling method b), but > those things are expensive. > > Matt > > > > > > > > On Fri, Dec 24, 2010 at 7:06 PM, Zeu5 wrote: > > Hi there, > > > my cakephp app allows users to create subdomains. > > > for eg, > > > user1 create

how to use ssl to secure subdomains of a cakephp app

2010-12-24 Thread Zeu5
Hi there, my cakephp app allows users to create subdomains. for eg, user1 creates subdomain1.example.com and user2 creates subdomain2.example.com and so on... all subdomains are pointing to the same app folder. if a new subdomain is created, i merely keep track of it by inserting new record i

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
= $this->saveAll($data, array('atomic' => false)); > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Fri, Dec 24, 2010 at 1:30 PM, Zeu5 wrote: > > Hi all, > > > i

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
n. So change your saveAll() call from > > $result = $this->saveAll($data); > > to > > $result = $this->saveAll($data, array('atomic' => false)); > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
Hi all, it did not work. I have tried This is for a Merchant Model; $datasource = $this->getDataSource(); $datasource->begin($this); $result = $this->saveAll($data); if (!$result) { $datasource->rollback($this); return false; } /** * do something to form a $domainData array **/ $result =

Re: how to use transactions in cakephp

2010-12-23 Thread Zeu5
Alright thanks! On Dec 23, 8:55 pm, Jon Bennett wrote: > > Unfortunately the 7 models are not interrelated to each other, some > > are of course related. > > > So i am not sure if saveAll allows that non interrelated models. > > I've only used transactions in cake to save related data, though I >

Re: how to use transactions in cakephp

2010-12-23 Thread Zeu5
Hi Jon > Use innodb and connect your keys/tables correctly. > Use saveAll not save and it will wrap all the SQL into a single transaction. Are you suggesting an alternative to http://book.cakephp.org/view/1633/Transactions ? Unfortunately the 7 models are not interrelated to each other, some ar

how to use transactions in cakephp

2010-12-23 Thread Zeu5
hi there, i have a 7 model transaction that needs to be rolled back whenever 1 of the tables do not commit properly. i found this but i am not sure how it works. http://book.cakephp.org/view/1633/Transactions I am vaguely familiar with MySQL transaction but prefer to follow cake way of doing th