Re: CakePHP 2.6 Controllers with New Folder Structure

2015-02-09 Thread Shiv Modi
Hi John,

I tried this solution as well but not working. Any other suggestion?

Regards,
Shiv

On Friday, 6 February 2015 01:36:41 UTC+5:30, John Andersen wrote:
>
> Please always reply to the group - I seldom checks my mailbox :)
>
> I looked in the CakePHP book and it did not show any examples of passing 
> all the different paths for different classes, so lets try this:
>
> App::build(array('Model' => array(APP . 'Model' . DS, APP . 'Model' . DS . 
> 'Customers' . DS, APP . 'Model' . DS. 'Products' . DS)));
> App::build(array('Controller' => array(APP . 'Controller' . DS, APP. 
> 'Controller' . DS. 'Customers' . DS, APP . 'Controller' . DS . 'Products' . 
> DS)));
>
> and so on. That should set it up with the full path as the book says it 
> needs. Please try and report back :)
> Enjoy, John
>
>
> On 5 February 2015 at 21:15, Shiv Modi  wrote:
> Hi John,
>
> I tried that one as well but not getting desired results.
>
> Regards,
> Shiv
>
> On Thursday, 5 February 2015 20:05:01 UTC+2, John Andersen wrote:
>>
>> You are trying to create an array that contains two entries with the same 
>> index - only the last entry with the same index will be used.
>>
>> Change your array to look like this - showing only the Model entry as an 
>> example:
>> 'Model' => array('/Model/', '/Model/Customers/', '/Model/Products/'),
>>
>> Do the same for Controller and View entries.
>>
>> Enjoy, John
>>
>> On Thursday, 5 February 2015 12:24:41 UTC+2, Shiv Modi wrote:
>>>
>>> Hi,
>>>
>>> I am using CakePHP 2.6 and want to make two sub-folders, Products and 
>>> Customers in app/Controller , Model and View folders. So that I can 
>>> categories my product and customer controllers for proper understanding. To 
>>> implement and access the same I done some changes in bootstrap as follow:
>>>
>>> App::build(array(
>>>   'Model' => array('/Model/', 
>>> '/Model/Products/'),
>>>  
>>>   'Controller'=> array('/Controller/', 
>>> '/Controller/Products/'),
>>>  
>>>   'View'  => array('/View/', '/View/Products/'),
>>>   
>>>   ));
>>>
>>> It worked well.
>>>
>>> But when i tried to add the entries for Customers controllers also it 
>>> will get overwritten by the other one: 
>>>
>>> App::build(array(
>>>   'Model' => array('/Model/', 
>>> '/Model/Customers/'),
>>>   'Model' => array('/Model/', 
>>> '/Model/Products/'),
>>>   'Controller'=> array('/Controller/', 
>>> '/Controller/Customers/'),
>>>   'Controller'=> array('/Controller/', 
>>> '/Controller/Products/'),
>>>   'View'  => array('/View/', '/View/Customers/'),
>>>   'View'  => array('/View/', '/View/Products/'),
>>>   
>>>   ));
>>>
>>> It's not working proper. Only Products section is working fine not 
>>> Customers one because keys are same and it's getting overwritten. How I can 
>>> fix this problem?
>>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is possible to make a online ticket booking website in CakePhp

2015-02-09 Thread Kamal Deol
Dear,

You can make any kind of web application in the Cake-PHP, it is just a
framework and you should know its convention first, what it can do and what
it can not .
The answer is YES you can .

On Mon, Feb 9, 2015 at 5:58 PM, Ankit Jaiswal 
wrote:

> HI,Maybe the question similar to this has been asked so many times, and
> many may votes this down, But i am really confused and i think its the best
> place to ask the professionals to resolve my problem.
>
>I have worked with Cakephp, Now I got a project where I have to create
> a website for online ticket booking system.
>
> So As the starting phase of project  before diving in to it I have to be
> sure *Is possible to make a online ticket booking website in CakePhp*
>
> Because right now I am working on  a website which has made in Cake Php,
> its not as Session oriented and not required  *ACID* property of Database
> which is the base of Online ticket booking system.
>
>So Please help me out and suggest me ideas related to it.
>
>  Thanks in Advance
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Plugin not working (controller file not found)

2015-02-09 Thread José Lorenzo
How does your composer.json file look like?

On Sunday, February 8, 2015 at 11:28:58 AM UTC-4:30, HVan wrote:
>
> I followed all the instrucitons, even tried baking a plugin. But each time 
> I reference the plugin (eg. http://localhost/contact_manager/contacts) it 
> says Controller not found. All the files have been created and placed in 
> the proper location. It will say file not found in 
> /plugins/ContactManager/src/Controller/ContactsController.php and I've 
> tripled checked, of course, that the file exists. I also created the Table 
> file - nada.
>
> It's loading the plugin properly because when I remove, say bootstrap.php 
> inside the plugin, it will say the bootstrap file is not found inside the 
> plugin.
>
> Any ideas?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Is possible to make a online ticket booking website in CakePhp

2015-02-09 Thread Ankit Jaiswal
HI,Maybe the question similar to this has been asked so many times, and 
many may votes this down, But i am really confused and i think its the best 
place to ask the professionals to resolve my problem.  

   I have worked with Cakephp, Now I got a project where I have to create a 
website for online ticket booking system.

So As the starting phase of project  before diving in to it I have to be 
sure *Is possible to make a online ticket booking website in CakePhp*

Because right now I am working on  a website which has made in Cake Php, 
its not as Session oriented and not required  *ACID* property of Database 
which is the base of Online ticket booking system.

   So Please help me out and suggest me ideas related to it.

 Thanks in Advance

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


How to default my site to cakephp app

2015-02-09 Thread alfonsoarias
Hello,
I am starting with CakePHP 2.6 . I created the basic app Posts , and it is 
working fine when I type in the browser http://www.mysite.com/posts 
I want to redirect my default site to it: so if I type in the browser 
http://www.mysite.com  it redirects to http://www.mysite.com/posts
1.)
I have in /etc/apache2/sites-enabled/000-default

ServerAdmin webmaster@localhost

DocumentRoot /var/www/project/app/webroot

Options FollowSymLinks
AllowOverride All


Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined



2.) I have in /var/www/project/app/webroot/.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]


3.)
When I type in the browser http://www.mysite.com , error.log is updated with
Request URL: /
Stack Trace:
#0 /var/www/project/lib/Cake/View/View.php(961): include()
#1 /var/www/project/lib/Cake/View/View.php(923): 
View->_evaluate('/var/www/projec...', Array)
#2 /var/www/project/lib/Cake/View/View.php(473): 
View->_render('/var/www/projec...')
#3 /var/www/project/lib/Cake/Controller/Controller.php(959): 
View->render('home', NULL)
#4 /var/www/project/app/Controller/PagesController.php(68): 
Controller->render('home')
#5 [internal function]: PagesController->display('home')
#6 /var/www/project/lib/Cake/Controller/Controller.php(490): 
ReflectionMethod->invokeArgs(Object(PagesController), Array)
#7 /var/www/project/lib/Cake/Routing/Dispatcher.php(193): 
Controller->invokeAction(Object(CakeRequest))
#8 /var/www/project/lib/Cake/Routing/Dispatcher.php(167): 
Dispatcher->_invoke(Object(PagesController), Object(CakeRequest))
#9 /var/www/project/app/webroot/index.php(118): 
Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#10 {main}


Thanks in advance for your help.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Can't pass argument, keeps coming up undefined?

2015-02-09 Thread Ryan O'Sullivan
 Hi guys,

i'm a bit new to PHP / Cake PHP, so go easy on me!

I'm trying to POST some key/values to a method within one of my API 
Controllers.
I'm not having any luck with it seeing the key/value i'm passing it though.
I'm trying to pass the method below islocationlive with a postcode (String).
It will then take this postcode, and check it against the table in my 
database.
When i hard core the postcode like below, it works. But i want to pass the 
argument in via Postman.
See attached. 
When i do it this way, it doesnt see it. I get Missing argument/undefined 
variable errors.

Any thoughts?  



public function api_islocationlive($postcode = '6000')
{

$live = ' ';

   $live = $this->Order->query("SELECT * FROM  postcodes WHERE postcode = " 
. $postcode . " AND is_live='Y'");
 
   if ($live) {
   echo $result['successfull'] = 'true';
} else {
echo $result['successfull'] = 'false';
}

}

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: empty controller/component directory

2015-02-09 Thread John Andersen
Check your CakePHP 2.x for the BlowfishPasswordHasher. It should be located 
in the path:
/lib/Cake/Controller/Component/Auth

At least that is where I found it in CakePHP 2.6.

Enjoy, John

On Sunday, 8 February 2015 21:21:59 UTC+2, vampke wrote:
>
> Hi,
>
> I just started with this excellent tool and I am trying to use the login 
> script as described by the example on the site (
> http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html
> ).
> The blog script is up and running, no problems there. 
> When I try to create a new user I receive the message "*Error: * Class 
> 'BlowfishPasswordHasher' not found"
> There do not seem to be any relevant posts about this issue. I have found 
> that my complete app/controller/component directory is empty. Is this 
> normal? 
> I have downloaded the script from the official website and again from 
> github. Both times the directory was empty. 
> Am I supposed to install this add-on? Where can I download it?
>
> v.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Correct model associations

2015-02-09 Thread John Andersen
Assuming you are using CakePHP 2.x

It is a good idea to define a primary key in your HABTM table - in the 
books_users table (name should be alphabetic order, but you can deviate). 
Thus your table definition is:
books_users
id, book_id, user_id

What is your comment table reflecting?
1) comments added to a book by a user?
2) comments added to a book_user?

To me it sounds like you have implemented 2) - if that is so, please 
clarify your reason :)

I would go with 1) - so that your comments table definition becomes:
comments
id, book_id, user_id, comment, ...
where book_id is a reference to the books table and user_id is a reference 
to the users table.

Enjoy, John


On Friday, 6 February 2015 22:46:08 UTC+2, gt0p wrote:
>
> I am trying to bind 3 tables and I am having problems with proper 
> relations. 
> Table users (pk id), books (pk id), users_books (user_id, book_id), 
> comments (pk and foreign key book_id, user_id -> with reference to 
> users_books)
>
> Here are the models:
>
> Book
>
>   public $hasAndBelongsToMany = array(
>   'User' =>
>   array(
> 'className' => 'User',
>   'joinTable' => 'users_books',
> 'foreignKey' => 'book_id',
> 'associationForeignKey' => 'user_id',
> 'unique' => true,
> 'conditions' => '',
> 'fields' => '',
> 'order' => '',
> 'limit' => '',
> 'offset' => '',
> 'finderQuery' => '',
>   //  'with' => 'UserBook'
> ),);
>
> public $hasMany = array('Comment'=>array('className'=>'Comment'));
>
> Comment:
>
>   public $belongsTo = array (
> 'Book' => array (
> 'className'=>'Book',
>
> )
>   );
>
>
> When I try to save with the saveAll method I got: 
>
> *Error: * SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot 
> add or update a child row: a foreign key constraint fails 
> (`metabook`.`comments`, CONSTRAINT `comments_ibfk_1` FOREIGN KEY 
> (`user_id`, `book_id`) REFERENCES `users_books` (`user_id`, `book_id`))  
>
> I know that this is not according to the cakephp conventions, but what I 
> can do to bind those tables?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.