This time I'll include the file names and where they are:

app\
  controllers\
    providers_controller.php (has ProvidersController class)
  models\
    Provider.php (has Provider class)
  views\
    providers\
      viewAdmitLookup.ctp (contains all of the view display stuff)

On Tue, Oct 25, 2011 at 9:16 AM, Yves S. Garret
<yoursurrogate...@gmail.com>wrote:

> Thanks, this is the structure of my directory tree, tell me if I need to
> re-name anything:
>
> app\
>   controllers\
>   models\
>   views\
>     providers\
>
> Should I rename the providers directory to provider?
>
>
> On Mon, Oct 24, 2011 at 11:33 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> Your conventions are all over the place. Its best to stick to them.
>>
>> Did you change the code inside the controller as suggested in my first
>> post?
>>
>>
>>    1. class ProvidersController extends AppController {
>>    2.     var $name = 'Providers';
>>
>>
>> The filename is view_admit_lookup, yet the controller function is
>> viewAdmitLookup - they should match. Change the function name to
>> view_admit_lookup
>>
>> In the view, you have this:
>>
>> echo <http://www.php.net/echo> $form->create("Providers", 
>> array<http://www.php.net/array>
>> ('action' => 'search'));
>>
>> It'll create a form that tries to find the Providers model, not the
>> Provider model. Change it to:
>>
>> echo <http://www.php.net/echo> $form->create("Provider", 
>> array<http://www.php.net/array>
>> ('action' => 'search'));
>>
>> Change Providers to Provider throughout the view code.
>>
>> In your controller function you have $this->set('providers'... which sends
>> a variable $providers into the view, yet in the view you are iterating
>> through a variable called $Providers. Change the variable in the view to
>> $providers.
>>
>> Your are using $form-> when you should be using $this->Form (that's the
>> syntax for helpers in general, so $this->Html etc).
>>
>> See this section of the book on conventions:
>>
>> http://book.cakephp.org/view/901/CakePHP-Conventions
>>
>> You can deviate from them with additional work, but it is not worth the
>> effort else you'll run into issues like this.
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 24 Oct 2011, at 22:39, Yves S. Garret wrote:
>>
>> Ok, now I'm getting this when I turned everything to plural.
>>
>>  Missing Controller
>>
>> *Error: **ProviderController* could not be found.
>>
>> *Error: *Create the class *ProviderController* below in file:
>> app\controllers\provider_controller.php
>>
>> <?php
>> class ProviderController extends AppController {
>>
>>      var $name = 'Provider';
>> }
>> ?>
>>
>> *Notice: *If you want to customize this error message, create
>> app\views\errors\missing_controller.ctp
>>
>>
>> Model:
>>
>> http://bin.cakephp.org/view/361596401
>>
>> View:
>>
>> http://bin.cakephp.org/view/1786526282
>>
>> Controller:
>>
>> http://bin.cakephp.org/view/1385185838
>>
>> On Mon, Oct 24, 2011 at 4:56 PM, Yves S. Garret <
>> yoursurrogate...@gmail.com> wrote:
>>
>>> Yup.  CakePHP 1.3.  The view is in
>>> \app\views\providers\view_admit_lookup.ctp
>>>
>>> The controller file name is providers_controller.php.  I added the
>>> variable that you suggested to the model file (which is called Provider.php)
>>> and I get the same error :-( .
>>>
>>>
>>> On Mon, Oct 24, 2011 at 2:03 PM, Jeremy Burns | Class Outfit <
>>> jeremybu...@classoutfit.com> wrote:
>>>
>>>> Did you change anything? This is 1.3, right?
>>>>
>>>> The filename should be providers_controller.php
>>>> Change the code as per my post below.
>>>> The view should be in /app/views/providers/
>>>> Add $var $name = 'Provider'; to the beginning of the Provider model
>>>> file.
>>>>
>>>>
>>>> Jeremy Burns
>>>> Class Outfit
>>>>
>>>> http://www.classoutfit.com
>>>>
>>>> On 24 Oct 2011, at 18:40, Yves S. Garret wrote:
>>>>
>>>> This is my view:
>>>> http://bin.cakephp.org/view/1913574686
>>>> This is my controller:
>>>> http://bin.cakephp.org/view/1556854836
>>>> This is my model:
>>>> http://bin.cakephp.org/view/416003093
>>>>
>>>> This is the error that I'm getting:
>>>> Missing Controller
>>>>
>>>> *Error: **ProviderController* could not be found.
>>>>
>>>> *Error: *Create the class *ProviderController* below in file:
>>>> app\controllers\provider_controller.php
>>>>
>>>> <?php
>>>> class ProviderController extends AppController {
>>>>
>>>>    var $name = 'Provider';
>>>> }
>>>> ?>
>>>>
>>>> *Notice: *If you want to customize this error message, create
>>>> app\views\errors\missing_controller.ctp
>>>>
>>>>
>>>> :-/
>>>>
>>>> On Mon, Oct 24, 2011 at 1:31 PM, Jeremy Burns | Class Outfit <
>>>> jeremybu...@classoutfit.com> wrote:
>>>>
>>>>> Your controller names should be plural; try:
>>>>>
>>>>>
>>>>>    1. class ProvidersController extends AppController {
>>>>>    2.     var $name = 'Providers';
>>>>>
>>>>>
>>>>>
>>>>> Jeremy Burns
>>>>> Class Outfit
>>>>>
>>>>> http://www.classoutfit.com
>>>>>
>>>>> On 24 Oct 2011, at 18:24, Yves S. Garret wrote:
>>>>>
>>>>> Ok, this is weird.
>>>>>
>>>>> I found this tutorial on doing searches.
>>>>> http://mrphp.com.au/code/search-forms-cakephp
>>>>>
>>>>> That's good.  Now, this is my Model:
>>>>> http://bin.cakephp.org/view/1495255597
>>>>> View:
>>>>> http://bin.cakephp.org/view/814828491
>>>>>  Controller:
>>>>> http://bin.cakephp.org/view/1212386780
>>>>>
>>>>> Now, when I run the search based on someone, I get something like this:
>>>>>  Missing Controller
>>>>>
>>>>> *Error: **ProvidersController* could not be found.
>>>>>
>>>>> *Error: *Create the class *ProvidersController* below in file:
>>>>> app\controllers\providers_controller.php
>>>>>
>>>>> <?php
>>>>> class ProvidersController extends AppController {
>>>>>
>>>>>   var $name = 'Providers';
>>>>> }
>>>>> ?>
>>>>>
>>>>> *Notice: *If you want to customize this error message, create
>>>>> app\views\errors\missing_controller.ctp
>>>>> Now, I don't have Providers, I have Provider (singular only), so where
>>>>> is it getting the plural from?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Oct 21, 2011 at 12:30 PM, Yves S. Garret <
>>>>> yoursurrogate...@gmail.com> wrote:
>>>>>
>>>>>> My question in that case would be, why am I getting that error?
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 20, 2011 at 5:12 PM, Yves S. Garret <
>>>>>> yoursurrogate...@gmail.com> wrote:
>>>>>>
>>>>>>> I have a decent understanding of what the tutorial is trying to do.
>>>>>>>  However, trying it to move it into my project is my present issue.
>>>>>>>
>>>>>>> Here is my model:
>>>>>>> http://bin.cakephp.org/view/792515073
>>>>>>> Here is my controller:
>>>>>>> http://bin.cakephp.org/view/514764310
>>>>>>> Here is my view:
>>>>>>> http://bin.cakephp.org/view/1923279272
>>>>>>>
>>>>>>> The issue that I get when I run Search:
>>>>>>>
>>>>>>> Missing Controller
>>>>>>>
>>>>>>> *Error: **ProvidersController* could not be found.
>>>>>>>
>>>>>>> *Error: *Create the class *ProvidersController* below in file:
>>>>>>> app\controllers\providers_controller.php
>>>>>>>
>>>>>>> <?php
>>>>>>> class ProvidersController extends AppController {
>>>>>>>
>>>>>>>         var $name = 'Providers';
>>>>>>> }
>>>>>>> ?>
>>>>>>>
>>>>>>> *Notice: *If you want to customize this error message, create
>>>>>>> app\views\errors\missing_controller.ctp
>>>>>>>
>>>>>>> provider_controller.php has a var $name = 'Providers'; as the
>>>>>>> name...
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Oct 18, 2011 at 3:27 PM, Dee Johnson 
>>>>>>> <devario...@gmail.com>wrote:
>>>>>>>
>>>>>>>> my apologies, I saw where you said you wanted to make the tutorial
>>>>>>>> simpler and i assumed that you already knew how to make calls etc.
>>>>>>>>
>>>>>>>> The tutorial is using a search behavior (which probably does the
>>>>>>>> calls - i haven't looked to verify)
>>>>>>>>
>>>>>>>> but to answer your question from above, I would recommend doing the
>>>>>>>> tutorial OUTSIDE of your current project just to familiarize yourself 
>>>>>>>> with
>>>>>>>> what it is asking you to do.
>>>>>>>>
>>>>>>>> Once you get that up and running you would have a much better
>>>>>>>> understanding of what direction you would rather go in as a developer.
>>>>>>>>
>>>>>>>> so...yes...follow all steps in the tut.
>>>>>>>>
>>>>>>>> Now, if you are going away from the tutorial, you can just the data
>>>>>>>> that comes back in the $this->data collection from your search box in 
>>>>>>>> the
>>>>>>>> view and use that model call I used above.  If you dont understand 
>>>>>>>> this last
>>>>>>>> bit, it is best you try the tutorial out first with a fresh install 
>>>>>>>> etc...so
>>>>>>>> as not to disrupt your project or in the very least back it up.
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Our newest site for the community: CakePHP Video Tutorials
>>>>>>>> http://tv.cakephp.org
>>>>>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>>>>>>> help others with their CakePHP related questions.
>>>>>>>>
>>>>>>>>
>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Our newest site for the community: CakePHP Video Tutorials
>>>>> http://tv.cakephp.org
>>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>>>> help others with their CakePHP related questions.
>>>>>
>>>>>
>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Our newest site for the community: CakePHP Video Tutorials
>>>>> http://tv.cakephp.org
>>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>>>> help others with their CakePHP related questions.
>>>>>
>>>>>
>>>>> 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
>>>>>
>>>>
>>>>
>>>> --
>>>> Our newest site for the community: CakePHP Video Tutorials
>>>> http://tv.cakephp.org
>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>>> help others with their CakePHP related questions.
>>>>
>>>>
>>>> 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
>>>>
>>>>
>>>>
>>>> --
>>>> Our newest site for the community: CakePHP Video Tutorials
>>>> http://tv.cakephp.org
>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>>> help others with their CakePHP related questions.
>>>>
>>>>
>>>> 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
>>>>
>>>
>>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> 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
>>
>>
>>  --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> 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
>>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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

Reply via email to