I know the issue of testing controllers with SimpleTest has come up
before but unfortunately has gone unanswered. I'm hoping that in the
time that has passed it has been figured out. Testing models works fine
but controllers on the other hand is a hazy area.
The first problem is actually instantia
no worries ;) open a ticket on the documentation, it should be in
there, but couldn't find it either ;)
On 8/21/06, Mikee Freedom <[EMAIL PROTECTED]> wrote:
>
> a that simple.
>
> thanks mate
>
> On 22/08/06, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> >
> > $this->Model->findAll(array('fiel
a that simple.
thanks mate
On 22/08/06, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> $this->Model->findAll(array('field' => '<= value'))
> On 8/21/06, Mikee Freedom <[EMAIL PROTECTED]> wrote:
> >
> > Hey all,
> >
> > A quick query.
> >
> > I prefer to include conditions as an array but was c
While we're talking implementations, I thought I'd chime in with how I
solved this problem).
My implementation was for editing Translations (I may post about my
i18n implementation in another topic soon enough). One example
specifically is for a user's first and last name (if I'm posting a
messag
$this->Model->findAll(array('field' => '<= value'))
On 8/21/06, Mikee Freedom <[EMAIL PROTECTED]> wrote:
>
> Hey all,
>
> A quick query.
>
> I prefer to include conditions as an array but was curious how to set
> conditions other than:
>
> field = 'value'
>
> i.e. Model->findAll(array('field' => '
Hi there,
It seems that Models associated via $hasMany are not done so via JOIN's. Rather, they are called as a separate query with the id of the calling model. Why is this?
This results in some strange behavior when certain conditions in the $fields array are defined.
e.g.
Product hasMany
Hey all,
A quick query.
I prefer to include conditions as an array but was curious how to set
conditions other than:
field = 'value'
i.e. Model->findAll(array('field' => 'value'))
Specifically I am trying to grab all records in the last month. But it
would be good to know if there was a quick
hey dood,
i don't know if this would be the best method but you can access the
controller from your views and layouts via:
$this->controller
so you can check for the controller name
if ($this->controller->name == 'Blahs') {
display
}
or for the modelClass
if ($this->controller->modelClass =
I need some help with something which looks like the cat chasing it's
tail, to me, but I am a beginner!
I have a component which I call from the default.thtml view, as I want
it in a sidebar, and that is defined there. But in fact, I would like
that component displayed/active only when the use
don't forget the Time helper
http://manual.cakephp.org/chapter/helpers
http://api.cakephp.org/class_time_helper.html
On 22/08/06, c_doug <[EMAIL PROTECTED]> wrote:
>
> Thanks, I'll have to try that once I get a little more advanced.
>
> I am trying to apply different variations of PHP date funct
you need to convert the date string to a unix timestamp before you can
use it in date() you can use the Time helper function toUnix to
accomplish this or look at
http://us3.php.net/manual/en/function.strtotime.php for the string to
time function.
the unix timestamp is probably your sticker on th
Thanks, I'll have to try that once I get a little more advanced.
I am trying to apply different variations of PHP date functions to it.
I am hoping to put a simple function around the 'created' variable
above. Something like:
date('mask', created).
--~--~-~--~~~---~
have you looked at the php date function? http://php.net/date or you
can do what I did and make a custom helper function that allows one to
custom format dates. like
function niceShort($date_string, $format='l j F Y', $return = false) {
$timestamp = $this->Time->toUnix
Can someone give me an idea of how to output a date in a certain
format? In this case I am trying to only output the month in the view.
Can I add a simple function to:
$a['Post']['created']
to make it output just a month or various date formats?
I have searched but haven't been able to apply w
So how would I use a function in the model User, from a seperate
component?
:)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To uns
Here's my solution. It's not the most elegant in the world, but it
gets the job done. If anyone has a suggestion for a better way, please
chime in.
$categoryData = $this->requestAction('/categories/select/');
$this->Product->Color->id = $color_id;
from the cakephp manual, quoted below, you can see how adding a few
parameters to the findAll function you can limit the number of rows
retrieved:
example:
$this->User->findAll('',null, '', 20, 2);
this gets the second page of results, containing 20 items each.
If you use a variable $page, for e
I just installed the latest cakephp release and tried doing the cake
blog tutorial. This one:
http://manual.cakephp.org/chapter/20
Here is the error I got:
Warning: Invalid argument supplied for foreach() in
/www/cakefun/cake/libs/controller/controller.php on line 604
Warning: Invalid argume
I found that I can use find() instead of read(), and set recursive = 2
to return category.title, however, this returns way more data than I
need and drastically affects performance. Not a usable solution.
--~--~-~--~~~---~--~~
You received this message because yo
the problem seems to be you are using some helpers , and you didn't
include the HTML helper, which contains the function $html->link()
just add the html helper to your controller.
tell us if it works :)
spark!
On 8/21/06, purepear <[EMAIL PROTECTED]> wrote:
>
> Hi,
> my problem:
>
> I have a
Is there a way to see what is the View file (and its path) that cakePHP
is trying to render in this action ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cak
Hi,
my problem:
I have a controller called - ProductCatsController with an action
- admin_index
I have a /views/productcats/admin_index.thtml file
But the this url /admin/product_cats/ says "Missing View" in the
title.. and some
"Notice: Undefined variable: javascript in "
You'll end up using $this->requestAction() for logic that spans
multiple models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To un
Yes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options,
I'm working on a similar scenario right now. I haven't found a
solution yet.
Maybe some seasoned Cake veterans will chime in on this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to
On Aug 21, 2006, at 4:55 PM, Simplerules wrote:
>
> Yes, it has a Model.
>
> 'Users' is a fully working area, but I need to access some data from
> the table Users in this component.
Just to clarify, are you using Cake vocabulary here?
Is your question that you want to know how to access and u
Yes, it has a Model.
'Users' is a fully working area, but I need to access some data from
the table Users in this component.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group,
On Aug 21, 2006, at 4:48 PM, Simplerules wrote:
>
> How do I do a raw SQL query?
If at all possible, I would use model functions, but you can also
always use the query() and execute() functions of the model as well.
> I need to access a table called 'Users', which belongs to
> UsersControlle
How do I do a raw SQL query?
I need to access a table called 'Users', which belongs to
UsersController, in a component Logins - is there a way to do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
Thanks ShepherdWeb!
Is there a way to limit the results like you can with the findAll? We'd
like to do pagination when you navigate to a Category.
Can we do this? or do we just have to dump all the data from the db
every time?
Thanks again,
Jimmy
--~--~-~--~~~---~
What am I doing wrong?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
Why not use http://rossoft.wordpress.com/2006/05/22/cookie-component/";>RosSoft's
CookieComponent?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@goog
Nope. It's not there.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
@Jimmy -
Check out this WIKI entry:
http://wiki.cakephp.org/docs:method:read
I hope this helps!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@goog
no worries.
if you run in to trouble you might also have to look at using:
$this->Room->create();
this method prepares your model for insertion each time. otherwise
once you use the model to save data it sets the id of that model and
then each subsequent save will be an update instead of an ins
I am using this to set cookies:
setcookie($Name, $Value, time()+$Length)
and it works, except the cookies are not accessible in CAKEPHP.
The cookies (unlike the CAKEPHP cookie) are set to cake_1.1.7.3363/
while CAKEPHP is set to cake_1.1.7.3363 ; When I do a print_r($_COOKIE)
I only find the CAKE
Hello Mike.
Thank you very much for the quick reply. This is definitely a nice and
elegant way to handle it. I think I should use it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to thi
Morning Mutabor,
I did a similar thing with Config values. I printed all of my Config
values on a single page and allowed the user to edit them at one time.
When creating the form I employed non-standard CakePHP form input
naming conventions and then interpreted these at the controller level.
e.
Hello. I have a model called 'Room'. I need to let user submit as many
rooms at once as he wants by placing javascript 'Add room' button.
Each time user press this button it pastes one more set of fields to
let user enter another room information. And in the end there is submit
button which submit
usually when I am starting a site that might have funky plurals I make a page that calls the Inflector class with the various calls for the words to see what cake thinks the plurals will be, if they are not what I expect, I either add them in the config/inflectors.php or change my thinking ;)
On 8/
I have a database schema with categories and products that are joined
with categories_products table. This makes it so a product can be
assigned to multiple categories.
I would like to find all of the products that belong to a category.
I've tried:
$this->Product->findAll(array("CategoriesProdu
Our inflector is pretty darn good, and can properly inflect most
English words without any extra hinting.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-p
Super-Secret Hint: if you search this list for 'Dreamweaver' and/or
'thtml', you might find a solution (or two) to your syntax highlighting
woes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To
you need to use the correct names, always !
if a pluralisation is irrigular (which is the case for city - cities)
of you have words that are the same in singular and plural, stuff like
that, you need to take a look at inflections.php in app/config/
the comments in there are very good to know wha
Dreamweaver has highlighting and other bells and whistles built into it
which i like.
they are based on the extension of the file you are editing. if im
editing an html file, it highlights the html as well as if i was
editing a php or asp, etc. file. Dreamweaver doesn't recognize the
'thtml' an
Brian French wrote:
> Is there a way to set it in the config for the app?
Just make file app/app_controller.php with this content:
> (i use dreamweaver and want to keep the code highlighting, etc.)
I don't understand what is matter :(
--~--~-~--~~~---~--~~
You
Is there a way to set it in the config for the app?
(i use dreamweaver and want to keep the code highlighting, etc.)
mouth wrote:
> ad 1)
>
> create file app/views/test.php with content:
> require_once 'cake'.DS.'libs'.DS.'view'.DS.'view.php';
> class TestView extends View {
> var $ext = '.t
Thanks nate, lots of help.
Jez.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
On Aug 21, 2006, at 9:33 AM, Zoltan wrote:
>
> Yes, I tried it and it seemed to work at first, then got some errors
> about missing controllers. This was about a week ago, but going from
> memory I used something like:
>
> class City extends AppModel
> {
> var $name = 'City';
> }
>
> and
>
>
Yes, I tried it and it seemed to work at first, then got some errors
about missing controllers. This was about a week ago, but going from
memory I used something like:
class City extends AppModel
{
var $name = 'City';
}
and
class CitiesController extends AppController
{..}
Does this look c
On Aug 21, 2006, at 9:21 AM, Zoltan wrote:
>
> A bit of a newbies question here, but what is the correct way to
> handle
> tables like 'city', should I name it 'cities' or 'citys'?
Have you tried it?
Should be 'cities'.
-- John
--~--~-~--~~~---~--~~
You rece
A bit of a newbies question here, but what is the correct way to handle
tables like 'city', should I name it 'cities' or 'citys'?
Thanks,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to
Perhaps I need to be more specific. I am importing the data from a
.csv file, so I am building the data structure myself, and the
information from the Manual does not explain how to create a data
structure for multiple hasMany records. So far I have managed to save
Member records, and I had no tr
Isn't that info available in $data['Category']? Given the
relationships you've established I think it would be there.
On 8/21/06, ShepherdWeb <[EMAIL PROTECTED]> wrote:
>
> Color and Product are hasAndBelongsToMany to each other
>
> Product belongsTo Category
>
> Category hasMany Product
>
> I'm
Hey guys, i just installed othauth, injected the logic in
app_controller, created some users, groups, incremented $gid a bit and
set $strict_gid_check to false in the component configuration (yes i
know this is not a clean method, i will fix this later and pass the
right stuff to the login method)
Hi Dear
Members,
FOLLOWING R THE JOBS OF THIS
WEEK :
Job Title
Job Posted By
IT
Recruiter
keriosolutions.inc
Req-0304 -Microsoft / Citrix System Engineer
keriosolutions.inc
Req-0285 - SQL / Oracle DBA
keriosolutions.inc
Hello fellow bakers!
first of all I'd like to tell you that I am an experienced php
developer for years, firstly with plain procedural way, last year OOP
and now I started baking with cakePHP, so I am really new to MVC
concept.
I decided that my first baked application would be a classifieds
sys
it would be great to have some kind of outgoing dispatcher method. so
that controller->redirect and all the helpers translate the urls. then
we could have one place to define the translation of the urls and one
to map the english urls to controller methods.
if you follow the concept of degradable
58 matches
Mail list logo