Using "'Model.column' => array(1, 2, 3)" with mssql

2010-03-09 Thread p_W
When I use this syntax with mysql, it seems to 'unpack' the array
correctly, and the query generated is something like

"...WHERE 'Model.column' IN (1, 2, 3)..."

When I use sql server, the query generated is

"...WHERE 'Model.column' IN 'Array'"...

which obviously generates an error.  Anyone have any suggestions?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin index page

2010-03-02 Thread p_W
Should have waited an extra couple minutes before asking...

Solution:
As it turns out, instead of putting a view called 'index.ctp' in the
app/views/pages/admin directory, I needed to put a view called
'admin_index.ctp' in my app/views/pages directory.






On Mar 2, 2:38 pm, p_W  wrote:
> In the Cookbook, it lists this as the way to connect the URL '/admin'
> to an admin index page.  I am having some trouble making this work
> correctly.  I do have admin routing activated, with 'admin' as the
> prefix.  Here are the routes, listed in order, in my routes.php page:
>
>          Router::connect('/', array('controller' => 'mycontroller',
> 'action' => 'index'));
>          Router::connect('/admin', array('controller' => 'pages',
> 'action' => 'index', 'admin' => true));
>          Router::connect('/pages/*', array('controller' => 'pages', 'action'
> => 'display'));
>
> I took the pages_controller.php from my cake/lib/controllers
> directory, copied it to my app/controllers directory, and added a
> function called admin_index() at the end of it.  I put a view called
> index.ctp in my app/views/pages/admin directory.  If anyone has any
> ideas, I would really appreciate it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Admin index page

2010-03-02 Thread p_W
In the Cookbook, it lists this as the way to connect the URL '/admin'
to an admin index page.  I am having some trouble making this work
correctly.  I do have admin routing activated, with 'admin' as the
prefix.  Here are the routes, listed in order, in my routes.php page:

 Router::connect('/', array('controller' => 'mycontroller',
'action' => 'index'));
 Router::connect('/admin', array('controller' => 'pages',
'action' => 'index', 'admin' => true));
 Router::connect('/pages/*', array('controller' => 'pages', 'action'
=> 'display'));

I took the pages_controller.php from my cake/lib/controllers
directory, copied it to my app/controllers directory, and added a
function called admin_index() at the end of it.  I put a view called
index.ctp in my app/views/pages/admin directory.  If anyone has any
ideas, I would really appreciate it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


POST from POST

2010-02-26 Thread p_W
I have a form that POST's to a controller called /controller/confirm.
In the confirm action, I collect the POST data and send it to the
confirm.ctp view.  In the view I am trying to generate another form
that asks the user to confirm their choices, and POST the data to a /
controller/savedata controller.  However, even though I am creating
the form in the confirm.ctp view, none of the form tags are showing
up.  Is POSTing from a page that was requested by a POST not possible?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Model Association 'chain'

2010-02-24 Thread p_W
I have 4 models, associated like this:

Model_1 has_many Model_2
Model_2 belongs_to Model_1

Model_2 has_many Model_3
Model_3 belongs_to Model_2

Model_3 has_many Model_4
Model_4 belongs_to Model_3

In my controller, when I call `$my_var = $this->Model_1->find('all')`
the results have Model_1 and Model_2 in them, but I would like it to
recurse down through the whole chain...any thoughts?  Should I just do
it manually in a model function?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Default Routes

2010-02-24 Thread p_W
Thanks everyone...the .htaccess files were indeed the problem.

On Feb 24, 4:18 am, Mohsin kabir  wrote:
> I think , You missed to upload the .htaccess file in the root
> directory , in /app directory and in /webroot directory . Plz check
> them.
>
> On Feb 24, 5:43 am, p_W  wrote:
>
> > When I am using cake in a development setup, and access the
> > application athttp://localhost/, the default routes work just fine.
> > However, when I put the app into production, I seem to have problems
> > if the app's webroot is not set as the documentroot of a virtualhost.
> > E.G., if I have a webserver with DocumentRoot /var/www/html, and I put
> > my cakephp app in the html directory, I should be able to go 
> > tohttp://example.com/myappanduse the app like normal.  However,
> > example.com/myapp/controller gives a webserver error.  I have
> > mod_rewrite enabled, and thought it would pipe all requests for the
> > top level cake folder down to the webroot?  Am I missing something?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Default Routes

2010-02-23 Thread p_W
When I am using cake in a development setup, and access the
application at http://localhost/, the default routes work just fine.
However, when I put the app into production, I seem to have problems
if the app's webroot is not set as the documentroot of a virtualhost.
E.G., if I have a webserver with DocumentRoot /var/www/html, and I put
my cakephp app in the html directory, I should be able to go to
http://example.com/myapp and use the app like normal.  However,
example.com/myapp/controller gives a webserver error.  I have
mod_rewrite enabled, and thought it would pipe all requests for the
top level cake folder down to the webroot?  Am I missing something?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


All tests report "Fatal error: Call to undefined method stdClass::find() in /var/www/..."

2010-02-11 Thread p_W
I just got done baking my Models and test cases, and have not altered
any of the files generated by the bake.  When I run the test cases for
my models, I get the above error message.  Any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: form select: value and displayed text from table

2009-10-07 Thread p_W

ah, var $displayField in my model will do just fine...sorry for the
premature question...

On Oct 7, 6:01 pm, p_W  wrote:
> Is there an option in the form helper that would let me end up with a
> select that is filled from a table, only with the 'id' column being in
> the 'value' part of the select, and the other column of the db filling
> the visible part of the select?  something like this:
>
> 
>   Label for 1
>   Label for 2
>   ...
> 
>
> or if this is more clear, something like this:
>
> 
>   Arkansas
>   ...
>   California
>   ...
> 
>
> ...where there is a db table with 'state_abbr' and 'state_name'
> columns.
--~--~-~--~~~---~--~~
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 to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



form select: value and displayed text from table

2009-10-07 Thread p_W

Is there an option in the form helper that would let me end up with a
select that is filled from a table, only with the 'id' column being in
the 'value' part of the select, and the other column of the db filling
the visible part of the select?  something like this:


  Label for 1
  Label for 2
  ...


or if this is more clear, something like this:


  Arkansas
  ...
  California
  ...


...where there is a db table with 'state_abbr' and 'state_name'
columns.
--~--~-~--~~~---~--~~
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 to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



unit tests not creating tables?

2009-10-06 Thread p_W

I was under the impression that tests were supposed to create tables
in the test db as needed, but I must be doing something wrong...

I have app_production and an app_test databases, and I set
app_production up just how I wanted it, kept app_test empty, and
used ./cake bake all to generate the models, controllers, views, and
tests.  I have not altered the tests in any way.  The functional tests
work fine, but the unit tests give me a 'Database table model_name for
Model ModelName was not found' for all models.  My test database
should be connected fine, as it is set up the same as my production db
and it is connecting just fine.  ./cake testsuite app all is not
working either, I get a similar error message.
--~--~-~--~~~---~--~~
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 to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Second DB datasource, not related to a model

2009-10-06 Thread p_W

At my company we have a large Oracle DB that stores the information
for all our employees and users.  The app I am writing uses a MSSQL db
and also has a 'users' table, as we want to store the information for
the users of our app in a different way than the information is stored
in the Oracle db.  When the user browses to the app, their employee id
is pulled from the $_SERVER['HTTP_REMOTE_USER'] variable, and we want
to pull some basic information about the user (name, status, etc) from
the Oracle db and store it in the MSSQL table.

How would you advise setting up the connection to the oracle db?  The
'user' model is hooked to the MSSQL db, and we only want to use the
oracle connection to get a bit of info and then it won't be used again
for that user.  Should I set the oracle connection up in database.php
and another source and use 'var $useDbConfig = 'oracle'' till I don't
need the oracle connection anymore, or just use old-fashioned
odbc_connect() functions in the user model's 'get_info_from_oracle'
function?
--~--~-~--~~~---~--~~
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 to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



rake routes equivalent?

2009-09-28 Thread p_W

I have recently started developing with CakePHP, but I have experience
with Rails.  I was wondering if there was something in Cake that is
equivalent to Rails' 'rake routes' command.  I always liked testing my
model associations with that command, so I hope there is something
similar in Cake.

--~--~-~--~~~---~--~~
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 to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---