First of all, this being my first post here, I just want to say hello to everyone and I'm really enjoying Phalcon, after using ZF2. The documentation is pretty much, so far spot on. There are a few things I need help with. I installed phalcon-php through the AUR for Arch Linux, that part went smooth, the online documentation was right to point me there, however the PDF version of it makes no mention of where to get it from, no biggie there, just a heads up, (I might have missed it).
The virtualhost file contents are probably fine for people running anything lower than Apache 2.4, might want to mention there are a vew slight changes to make if you're using anything above that, here's mine:
<VirtualHost local.phalcon-tutorial.com:80>
ServerAdmin [email protected]
ServerName local.phalcon-tutorial.com
ServerAlias local.phalcon-tutorial.com
DocumentRoot "/webroot/phalcon-tutorial/public"
SetEnv APPLICATION_ENV "development"
ErrorLog "/webroot/phalcon-tutorial/logs/local.phalcon-tutorial.com-error_log"
CustomLog "/webroot/phalcon-tutorial/logs/local.phalcon-tutorial.com-access_log" custom
<Directory "/webroot/phalcon-tutorial/public">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride FileInfo
Require all granted
</Directory>
</VirtualHost>
Directing my browser to local.phalcon-tutorial.com, displays the page just fine, minus the baseurl as it is define in the index.php file in the public folder:
//Setup a base URI so that all generated URIs include the "tutorial" folder
$di->set('url', function(){
$url = new \Phalcon\Mvc\Url();
$url->setBaseUri('/tutorial/'); // except mine is, $url->setBaseUrl(''/'); Read below why please,...
return $url;
});
This is fine, that page loads and displays fine, however when it comes to the next part of the new project tutorial, setting up and introducing the signup portion of it, the page wouldn't load. Changing the above baseUrl value to what I mention in the comments beside it, cause it then to load just fine. My project directory is set up:
phalcon-tutorial/
├── app
│ ├── controllers
│ │ ├── IndexController.php
│ │ └── SignupController.php
│ ├── models
│ └── views
│ ├── index
│ │ └── index.phtml
│ └── signup
│ └── index.phtml
├── conf
│ ├── dev.phalcon-tutorial.com.conf
│ ├── local.phalcon-tutorial.com.conf
│ └── test.phalcon-tutorial.com.conf
├── logs
│ ├── dev.phalcon-tutorial.com-access_log
│ ├── dev.phalcon-tutorial.com-error_log
│ ├── local.phalcon-tutorial.com-access_log
│ ├── local.phalcon-tutorial.com-error_log
│ ├── test.phalcon-tutorial.com-access_log
│ └── test.phalcon-tutorial.com-error_log
└── public
├── css
├── img
├── index.php
└── js
12 directories, 14 files
So when I added a link back to the main page, from the signup, this is what I had to do to get to work:
<?php use Phalcon\Tag; ?>
<h2>Sign up using this form</h2>
<?php echo Tag::form("signup/register"); ?>
<p>
<label for="name">Name</label>
<?php echo Tag::textField("name") ?>
</p>
<p>
<label for="email">E-Mail</label>
<?php echo Tag::textField("email") ?>
</p>
<p>
<?php echo Tag::submitButton("Register") ?>
</p>
<p>
<?php echo Phalcon\Tag::linkTo("", "Return home!"); // This bit here was added to test how to return back to the main page / index ?>
</p>
</form>
I know it works, for now. My main question is does anyone here see any potential problems that this might lead to, eventually? Thanks in advance and have a super wonderful rest of the day!!!