Add init method in your component:
public function initialize(&$controller) {
$this->controller =& $controller;
}
Use set() everywhere you need:
$this->controller->set()
On Mar 7, 9:24 am, Miles J wrote:
> So I recently build a Mailer Component that would deal with all the
> emails. But the
On Mar 7, 2:13 am, weckmann wrote:
> Unfortunately it stops joining tables after ModelB... so ModelB gets
> correctly joined, but ModelC is ignored, even if I set the 'recursive'
> parameter to 3... as far as I understood the whole thing, this should
> find the link in ModelB to ModelC... but it
I am already working a lot with linking models together, but not in
that recursive way, mostly only with one belongsTo relation.
But your hint "specifing the count in the 'fields' array" was a good
step in the right direction, I finally got the correct SELECT
statement created by cake ;-)
The
Wondering if I could get some general feed back on what would be the
best way to set up ACL with a situation like this.
Education site basically.
A User signs up and during registration they select they teaching
professional level ( Pre-School thru Grade 12 each with a value in the
database 1-13
I figured it right afterwards
thanks
Dave
_
From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com]
Sent: March-07-09 1:26 AM
To: cake-php@googlegroups.com
Subject: Routes
Can someone provide a simple way to configure routes? Been trying this to no
avail.
What I wa
Can someone provide a simple way to configure routes? Been trying this to no
avail.
What I want is to remove the view/1 from the URL so it looks like
www.site/posts/1 and not www.site/posts/view/1
Router::connect('/posts/*', array('controller' => 'posts', 'action' =>
'view', 'view'));
Dave
On Mar 6, 5:13 pm, weckmann wrote:
> How would I need to link the models together and how do I need to form
> the count?
I would suggest taking a look here about associating models:
http://book.cakephp.org/view/78/Associations-Linking-Models-Together
The count can be specified in the 'fields' ar
On Mar 6, 12:57 pm, "miguelarc...@gmail.com"
wrote:
> I have the following Model/table associations:
>
> Feedback hasmany Competency
> Competency hasmany Questions
>
> Is saveAll the way to go? and if so, how do I do it?
saveAll currently does not support saving of deep relationships like
this.
So I recently build a Mailer Component that would deal with all the
emails. But then I ran into the issue, which I forgot about, is that
set() only works in the controller. So now since im doing it in a
component, I cant pass any variables to the email.
Is there a work around to this, to not have
Still no luck. I need the scriptaculous.js in there for other elements on
the page.
In the view file:
link(array('prototype', 'scriptaculous', 'effects',
'accordion'));
?>
Title Bar
Well i listened to all you guys out there in my forum and my blog
and
Whit the console, specifically with the bake shell, you can set up the
database configuration, generate the models automatically from the
tables, the controllers with crud actions and the views for this
actions.
Look at http://book.cakephp.org/view/108/the-cakephp-console,
http://book.cakephp.org
Edit the default layout at app\views\layouts\default.ctp and add a
element (at app\views\elements) placing it where you want. You can
access de data from the db using the element's requestAction method.
Read http://book.cakephp.org/view/94/Views
On Mar 6, 9:35 pm, ashutosh wrote:
> hi all,
> I
Thank you for your response.
Do you mean use the cake bake scaffold thingy to generate a scaffold?
On Fri, Mar 6, 2009 at 11:17 AM, Xoubaman wrote:
> Use the console to generate basic crud actions for your models. You
> can generate the models also. The code will be simple enough to get a
> ide
Well I use this technique, it only loads models that we need for that
current action. Cuts down the models tremendously.
http://www.milesj.me/blog/read/16/loading-models-specific-to-certain-actions
--~--~-~--~~~---~--~~
You received this message because you are sub
Hi !
I builted my application originally to deal with Tasks belonging to
one subproject, which itself was belonging to one project. A project
could have one or more subprojects, which could have one or more
tasks.
Unfortunately, I have to change that to be able to pass the subproject
step. I need
Thanks to IRC channel guys I solved the pbm: Remove all the php
closing tags ?> from your code and it solved the pbm.
Thanks to the CakePHP community!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" gro
Hi together,
I have problems to create a count query with recursive conditions...
To clear up things, I ll try to make an example:
We have 4 tables:
ModelA, ModelB, ModelC, ModelD
They are connected like this:
- ModelA contains a FK to ModelB.
- ModelB contains a FK to ModelC.
- ModelC conta
removing all closing ?> on your models, controllers, components and helpers
may help (they are not needed)
Saludos,
Pablo Viojo
pvi...@gmail.com
http://pviojo.net
(#220 y creciendo!)
Ayudar nos hace felices!
http://needish.com - http:/
Looking in forums I have found this:-
http://bytes.com/topic/xml/answers/685843-xml-version-1-0-encoding-utf-8-creting-problem-mozilla-firefox
Although **I** don't introduce the line feed they are talking about, I
presume it is inserted by CakePHP in the code, I cannot find where
with my debugge
hi,
i've set up the l10n class with success on my local server.
i can make __('string') read the app/locale/eng/LC_MESSAGES/default.po
file based on $_SESSION['Config']['language']
but it is not working on the production server.
i've read somewhere that there is a problem with 64bit servers. tr
Hi I have no idea how best to install cakephp and have it work at
correctly
This is my setup (on dreamhost)
\
\www.mydomain01.com
\www.mydomain02.com
\www.mydomain03.com
\cake_install\app
\cake_install\cake
\cake_install\vendors
\cake_install\.htaccess
\cake_install\index.php
\cake_install\README
hi all,
I was trying cakePHP to make my site. this side has left side bar
which picks the catalog data from db and the middle content depending
upon the some other parameter. Left side bar will always be same
format and will be picked up from db. any idea how should i do that? i
am new to cakePHP.
Profiling my applications give me some good insights about where our
application is having bottlenecks.
The slow methods within cake core are:
1. Loading models takes a lot of the time (85% of the total time),
specifically at Model::__createLink
2. FormHelper::select with large lists
Is there any
Sry, I didn't quite get it...
I want to load the content in all languages of the Model I'm in, no an
associated one!
I need a function which load all/the choosen languages of the record
I'm editing
e.g. localhost/blogs/edit/2
the printed find-method should something like this:
Array
(
[0] =>
I have soundmanager2 serving up mp3s on a music library site, but
every so often soundmanager in safari will not link up when an mp3 is
clicked. When I reset safari it will work fine again, but clearing the
cache does not help.
If you are running safari and have a few minutes to spare please visi
> The input type is multiple checkboxes. I think that’s where the problem is
> coming from.
If that's true, try it without that option and see if it renders
properly. If it is true, there may be a solution that good ol' Google
could help us find. I haven't yet had a reason to use the multiple
o
Apologies for continuing to pound away at this thread, but I had another
issue come up. In addition to views, pages also have votes. When I tried to
count the votes and views, both counts are the same and are "wrong"—due to
the way the tables are being joined, the count doesn't work as desired.
Not sure if you need the scriptaculous script for anything else, but
you don't need it for this. Also you're missing effects.js which is
specified on the website.
You might wanna take out some of that code too, you don't need all of
that, for instance:
> var topAccordion
ARRGH... Can we delete this ? :)
one hour of FAIL could have been solved if I had read the full article
on this at
http://book.cakephp.org/view/36/Additional-Class-Paths
But I missed the last sentance... "Make sure that each path specified
includes a trailing slash. "
so I changed my bootstra
whoops...copy and paste ...
The controller "not found error" was:
app/controllers/xpage_types_controller.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake
More details
When the view can't be found the error shows it's looking in the fully
qualified path for the app like:
/Users/hardy/Sites/xch_master/app/views/xpage_types/xchange_index.ctp
But when a Controller or Model can't be found it just looks starting
in the app folder like:
app/views/
Hi! I'm beginner with cakephp.
I have binded models with HABTM
Model 'Field':
**
var $name = 'Field';
var $hasAndBelongsToMany = array(
'Category' => array('className' => 'Category')
);
**
i use :
**
$result=$this->find('all');
**
I can s
Hello,
Sorry if this is too much of a noob question, but here it goes:
I have the following Model/table associations:
Feedback hasmany Competency
Competency hasmany Questions
Is saveAll the way to go? and if so, how do I do it?
Thanks in advance.
--~--~-~--~~~---~
ok here is what I have in my view file.
link(array('prototype', 'scriptaculous', 'accordion' ),
false);
?>
//
// In my case I want to load them onload, this is how you
do it!
//
Event.observe(window, 'loa
I was overthinking the bind. Instead of bindModel() in the controller, just
needed the following association in the Page model:
var $hasOne = array(
'PageViewTotal' => array(
'className' => 'PageView',
'type' => 'inner'
)
);
Between that and the afterFind() callback,
Use the console to generate basic crud actions for your models. You
can generate the models also. The code will be simple enough to get a
idea about how cake works.
On Mar 6, 4:53 pm, a_summer wrote:
> Good Day,
>
> Thank you for taking the time to read this discussion.
>
> I am new to MVC design
Further testing ... My $modelPaths also works...
I moved the model out to the "core" app directories and my app was
able to use the model in the core.
So still wondering about $viewPaths
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Hehe, I got this working 2 days ago,
Check out his source code, there's more then a few hints in there.
But yeah, post your code. So we can see whats going on.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakeP
I have placed the following code in my Cake 1.2 RC2 bootstrap file:
$xch_core_path = '/Users/hardy/Sites/xch_core/app/';
$modelPaths = array($xch_core_path.'models');
$viewPaths = array($xch_core_path.'views');
$controllerPaths = array($xch_core_path.'controllers');
Controllers are working fine
On Fri, Mar 6, 2009 at 11:31 AM, Dave Maharaj :: WidePixels.com
wrote:
> I am trying to get this working on my application.
> http://stickmanlabs.com/accordion/
>
> I have the scripts in the folder, added to page layout. Checked the html
> (Firebug) and see the scripts are loaded correctly.
>
> A
I am trying to get this working on my application.
http://stickmanlabs.com/accordion/
I have the scripts in the folder, added to page layout. Checked the html
(Firebug) and see the scripts are loaded correctly.
Actually copied / paste the code from the demo after trying my own and still
nothing
you might be interested in
cakebaker.42dh.com/2007/03/17/mvc-with-javascript/
www.javascriptmvc.com
- S
2009/3/6 yogesh kumar :
>
> use css and javascript in layout default.php
>
>
>
> >
>
--~--~-~--~~~---~--~~
You received this message because you are subscr
Here's the afterFind(). It works. Would just like some comments on whether
this is a sound approach.
function afterFind($results) {
if(!empty($results[0]['Page']) &&
!empty($results[0][0]['total_view_count'])) {
$i = 0;
foreach($results as $result) {
$results[$i]['Page'
Ummm, try setting your layout to be of ajax type and see how it goes.
function toto() {
$this->layout = 'ajax';
$this->render( null, '/xml/default', null );
}
Regards,
Alfredo
On Fri, Mar 6, 2009 at 11:24 AM, Aktarus wrote:
>
> Hello,
>
> I have an Ajax that requests XML feed to one o
@grigri: Thanks. Just what I was looking for. I hadn't used bindModel()
before, but now makes total sense on getting from the SQL to Cake query.
This does lead me to two follow up questions...
The $results array looks like this:
Array
(
[0] => Array
(
[Page] => Array
Still no luck.
My view has input('User',array('multiple'=>'checkbox',
'div'=>false, 'label'=>false));
?>
The input type is multiple checkboxes. I think that’s where the problem is
coming from. The html rendered is:
ColdPlay
Would it be easier to do a foreach type setup? Tha
use css and javascript in layout default.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email
Hi
I must to make a big application in CAKEPHP.(Like a multiservice
platform).
Before to start the develop I would ask what is the best way to
organize the CSS and the javascript for a big application?
Many Thanks
--~--~-~--~~~---~--~~
You received this message beca
Hello,
I have an Ajax that requests XML feed to one of my CakePHP action.
My action works great and returns something like:-
So far so good... with IE, because my Ajax does not work with
Mozilla!
Mozilla returns the following error message when accessing the action
that ough to return the X
If you insist on using the helper and HAVE to have the markup you
list, it'll be mostly a manual exercise in overriding default
behavior. For a project that I did, I did the following:
Type of Report
input('type', array('type'=>'radio', 'options'=>array
('public'=>'Public Incident/Accident','sta
Try this:
$this->Page->bindModel(array(
'hasOne' => array(
'PageViewTotal' => array(
'className' => 'PageView',
'type' => 'inner'
)
)
));
$results = $this->Page->find('all', array(
'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
page_view_count'),
'group' => 'P
Good Day,
Thank you for taking the time to read this discussion.
I am new to MVC design, and I need to understand how to create a view/
controller that will insert records into a model that uses the hasMany
association.
The table layout and code for the models is below:
MySQL DB Create Table
[
This doesn't work because 'view_count' is not a field. All of the view data
is contained in the 'View' model, keyed to the 'Page' model (Post in your
example).
Maybe it would help if I share the full details of my models, tables and the
SQL query/result I would like to create in Cake:
Page hasM
Sorry to keep bumping and adding, but a workaround that I've managed
to find is to use the Routing.admin configuration setting. This is a
*serious* hack though, as there is already a CMS section attached to
this project, and it really isn't ideal to have two separate
applications for different sec
$topTen = $this->Post->find('list',
array(
'fields' => array('Post.id', 'Post.view_count'),
'order' => array('Post.view_count DESC'),
'limit' => 10
)
);
this worked for me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Hello,
I am trying to protect some of my pages with the basic Http
Authentification provided by the SecurityComponent (those pages are
indeed RSS feeds), but even if everything worked great on my local
machine, it kind of fails while online on my Dreamhost server.
I have set up a really simple p
After doing some more searching, I came across the section in the
cookbook concerning prefix routing. There were one or two little
things that I was doing incorrectly, and those have been corrected.
However, I took a look at the example that they set out in the
cookbook, and tried it in my applic
Yeah, I've tried every possible combination that I can think of, and
nothing seems to work correctly. One thing I have noticed is that when
the passedArgs array is passed to the paginator helper, if there is
any other named parameter other than "page", the routes do not work.
So, I'm guessing that
Thanks, but that doesn't address the issue. Removing the condition does not
make the Cake query match the SQL query (or a LEFT JOIN equivalent).
The normalized database has a views table that contains a record of each
individual visit to a page. I do have my Cake associations properly setup:
Pag
I've got a fully working version of POST pagination that is crawlable,
and fully supports HABTM relationships.
First of all, I use this component for HABTM pagination (only really
useful for multiple relationships, otherwise you would just do it
directly from the join model) -
http://bakery.cake
Remove that condition, you should be using associations instead. Once
you have an association, all related data will be returned, simply
contain it or up the recursion.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Why not just code the label manually without using the helper?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this g
1000 rows is nothing, try 100,000 rows, then that would possibly
stress test the database and models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@goog
Do custom queries? You dont have to use relations.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send e
Alfredo Quiroga-Villamil wrote:
> Btw, I think I might have missed a digit in that regex:
>
> /\w+-\w+-\w+-\d+-\+-\d+-\w+-\w+/
>
>
>
Thanks Alfredo.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group
class Post extends AppModel {
var $name = 'Post';
var $hasMany=array('Comment');
function beforeSave()
{
if(!isset($this->data['Post']['id']))
{
if($this->data['Post']['url']=="")
{
$title_low=strtolower($this->da
It's not working even you pass all params to paginator in view:
$paginator->options(array('url'=>array_merge(array('prefix'=>$this-
>params['prefix']),array('wap'=>true), $this->passedArgs)));
debug($paginator->options);
Bug?
I would like to see multiple Routing.admin, like
Routing.admin
Routing
Hello,
thank's for the reply...
I have added "with" parameter and now all is ok in the new cake
version too.
I have read again the documentation (http://book.cakephp.org/view/78/
Associations-Linking-Models-Together ) and I have observed the use of
"with":
" with: Defines the name of the model fo
Apology accepted.
I use the grid component with the filter plugin.
On Mar 6, 10:12 am, Son Dat Giang wrote:
> Oh, yes. I'm sorry if you don't like the way I show my opinion. I have never
> heard about ext js before.
> I've visited some ext js demo, hmmm... It's realy valueable.
>
> But, i don't
I would start a simple test with two different database.
one very small with at least one but no more than 5 records per table.
Then do another test with a database with at least 1000 records in the
tables that you would expect to grow.
If your code is setup correctly with view pagination etc. th
I guess that your best chance is to switch the direction that you talk
with your models.
On Mar 6, 7:26 am, Braindead wrote:
> Miles, that's bad news. But how can I solve my problem? Is there any
> workaround?
--~--~-~--~~~---~--~~
You received this message becau
How to do validation without a database table:
You still need a model. For a concrete example, check out Snook's
CakePHP contact form: http://snook.ca/archives/cakephp/contact_form_cakephp/
Where to put common controller functions? Create a component.
Hope this helps
On Mar 5, 11:00 pm, D4rko
Yes, it is possible to use validation without a table. Simply define
$useTable = false in your model and define the validation rules as if
there was a table. You can then use cakes form helper without any
problems.
This is how you can force validation in your controller (part of my
contact page):
I have similar problem.
I have an element inside a view and I would on a click of a button
that the element would be reloaded with same params of first render.
Can someone suggest me some solution?
On Feb 28, 6:49 am, Corey Crawford wrote:
> OK, finally getting a chance to look at this again. T
Oh, yes. I'm sorry if you don't like the way I show my opinion. I have never
heard about ext js before.
I've visited some ext js demo, hmmm... It's realy valueable.
But, i don't know how to switch cake pagination method from GET to POST.
What situation of extjs are you using ?
Is there any cakep
On Mar 6, 1:40 am, kaushik wrote:
> I want to create a link like this:
>
>
Try:
link(' ', "../", array('alt'=>'Home', 'escape'
=> false)) ?>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post
Thanks for your "kind" response.
I think that make search with POST it's not so stupid Infact I have a
element with EXT js (i think that also Ext js developer team don't
need to be stupid) that make search with POST of data.
I hope that if there is the possibility to pass data to pagination
with P
I haven't tried it, but maybe this can help:
http://bakery.cakephp.org/articles/view/overriding-specific-html-tags-before-using-helper-methods
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post
tnx Smelly Eddie
i must tell again i am not the site administrator and just a visitor of some
sites that used the captcha and i need for those sites see SAME captcha
image on every load
tnx again
--
View this message in context:
http://www.nabble.com/Captcha-reload-problem%2C-works-in-ff-not-
79 matches
Mail list logo