Hey,
So I have a few issues setting up my application.
First, I created a model and:
use Phalcon\Mvc\Model;
class TelegraphGroup extends Model {
protected $id;
protected $name;
}
- It wants me to implement getConnectionService, setForceExists etc.. nothing like that in documentation. What is it?
- When I try to instantiate a model in my controller "$model = new TelegraphGroup();" it says "Fatal error: Class 'TelegraphGroup' not found" Though in my loader.php I have this:
$loader->registerDirs(
array(
$config->application->controllersDir,
$config->application->modelsDir,
$config->application->pluginsDir
)
)->register();
Models are registered.. :/
Second, Lets say I have a form built within a view:
{% block content %}
<form role="form" id="form-group-add" action="/groups/create">
<div class="form-group">
<label for="group-name">Название группы</label>
<input type="text" class="form-control" id="name" name="name">
<div class="form-error"></div>
</div>
<button type="submit" class="btn btn-default">Создать</button>
</form>
{% endblock %}
- How can I use Phalcon filters and validation in controller if my form wasn't created with Phalcon's form object? I don't want to write weird validations with php and not using the pwoer of Phalcon....
- My form goes to /groups/create, which adds the record to database and now I want to go back to the same "add" view and tell the user that It's all right or there's an error, how can i properly redirect back with some new variable values injected into the view?
Thanks guys!