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
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
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
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_
#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
y($this->viewVars['iterators']) ? array() :
> $this->viewVars['iterators'];
> foreach($iterators as $alias => $data) {
> $iterators[$alias] = ArrayConverter::createAggregator($data);
> }
> $this->viewVars['itera
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
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?
>
>
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
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:
>
>
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($
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
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
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
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
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
Paginated array
Array
(
[0] => Array
(
[Product] => Array
(
[id] => 8
[shop_id] => 2
[title] => test
[code] =>
[description] => test
[pric
27;image'] = $image;
unset($images[$product_id]);
break;
}
}
}
/* $realProducts is the result I want */
On Mar 21,
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
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/
. 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.
>
> 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
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'
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
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
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
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
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
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
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
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
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
= $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
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
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 =
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
>
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
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
38 matches
Mail list logo