Skip to content

Conversation

@paulbalandan
Copy link
Member

Description
Fixes #7472

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell
Copy link
Member

This seems like the wrong fix, honestly. This is why originally the intent was to have either the class with Cell appended, or the view with _cell appended, so they were different.

I know we had a cleanup recently that I didn't get a chance to look into, but if it removed the appending from either one then that should be fixed so that one or the other gets something appended.

@kenjis
Copy link
Member

kenjis commented May 4, 2023

The recent fix is #7392

@lonnieezell Do you mean the original intent is like this?

  • Blog → blog_cell.php
  • BlogCell → blog.php

It seems to be confusing.

The current naming rule is already complicated and I personally would like to see them simplified.
For example,

  • Blog → Blog.html.php
  • BlogCell → BlogCell.html.php

or

  • Blog → blog.html.php
  • BlogCell → blog_cell.html.php

or

  • Blog → blog_cell.php
  • BlogCell → blog_cell_cell.php

@lonnieezell
Copy link
Member

The original intent was, I believe:

Controller: BlogCell.php
View: blog.php

It's nice and simple, matches what we have a tendency to do elsewhere (view is lowercased, class has function attached, like UserModel or UserController).

@kenjis
Copy link
Member

kenjis commented May 4, 2023

If we follow the following rule (it is valid in the current implementation),
the classname must be two or more words.

Controller: BlogCell.php
View: blog.php

@lonnieezell
Do you want to append Cell automatically when we run make:cell Blog?

@paulbalandan
Copy link
Member Author

The appending of the Cell in the controller should be controlled by the --suffix option.

@lonnieezell
Copy link
Member

Do you want to append Cell automatically when we run make:cell Blog?

That's the way I would handle it, yes.

The appending of the Cell in the controller should be controlled by the --suffix option.

While I understand what you're saying I think it's a better experience to automatically add it then to throw and error and make them try again.

@paulbalandan
Copy link
Member Author

@lonnieezell If I understand correctly, the specification would be:

$ php spark make:cell BlogCell

File created: APPPATH . 'Cells/BlogCell.php'

File created: APPPATH . 'Cells/blog.php'
$ php spark make:cell Another

File created: APPPATH . 'Cells/AnotherCell.php'

File created: APPPATH . 'Cells/another.php'

@lonnieezell
Copy link
Member

@paulbalandan Correct.

@kenjis kenjis added stale Pull requests with conflicts bug Verified issues on the current code behavior or pull requests that will fix them labels May 14, 2023
@kenjis kenjis closed this in #7481 May 21, 2023
@paulbalandan paulbalandan deleted the make-cell-case-insensitive branch May 21, 2023 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them stale Pull requests with conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: case-insensitive treatment of single-word view cells in Windows and macOS

3 participants